You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
///Save to cache
do {
let fullKey = "\(root)_\(key)"
let cache = try Cache<NSData>(name: UserTrackingCache.cacheName)
let cachedData = NSKeyedArchiver.archivedDataWithRootObject("Y")
cache.setObject(cachedData, forKey: fullKey, expires: CacheExpiry.Seconds(UserTrackingCache.locationCacheTime))
} catch _ {
Log.error("Something went wrong with the cache = \(UserTrackingCache.cacheName)")
}
I remove the expired cache when App starts in AppDelegate
do {
let cache = try Cache<NSData>(name: UserTrackingService.UserTrackingCache.cacheName)
cache.removeExpiredObjects()
} catch _ {
Log.debug("Something went wrong with the cache")
}
But I found the cache timeout sooner than I expected. Almost after a few hours, it expires
Does anyone encounter the same issue? or did I do something wrong ?
The text was updated successfully, but these errors were encountered:
I set the cache time to 24 hours
I remove the expired cache when App starts in AppDelegate
But I found the cache timeout sooner than I expected. Almost after a few hours, it expires
Does anyone encounter the same issue? or did I do something wrong ?
The text was updated successfully, but these errors were encountered: