-
It was observed that iOS devices which had an old logo cached were not properly expiring the cache lifetime set in Akamai (24 hours). The default settings for diskCacheAccessExtendingExpiration is .cacheTime, meaning every time the logo is accessed from the cache, its lifetime is extended by 1 week. We should switch the behavior to diskCacheAccessExtendingExpiration(.none) and verify this on the server for cache lifetime. I attempted to change the default options by setting the diskCacheAccessExtendingExpiration = .none @objc func setKingfisherCacheExpiration() {
let currentCacheDefaultOptions = KingfisherManager.shared.defaultOptions
var cache = KingfisherParsedOptionsInfo(currentCacheDefaultOptions)
cache.diskCacheAccessExtendingExpiration = .none |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Not sure how did you set it globally, but can you try this? KingfisherManager.shared.defaultOptions
.append(.diskCacheAccessExtendingExpiration(.none)) |
Beta Was this translation helpful? Give feedback.
-
Instead of var currentCacheDefaultOptions = KingfisherManager.shared.defaultOptions
currentCacheDefaultOptions.append(.diskCacheAccessExtendingExpiration(.none)) You need KingfisherManager.shared.defaultOptions
.append(.diskCacheAccessExtendingExpiration(.none)) Or var currentCacheDefaultOptions = KingfisherManager.shared.defaultOptions
currentCacheDefaultOptions.append(.diskCacheAccessExtendingExpiration(.none))
KingfisherManager.shared.defaultOptions = currentCacheDefaultOptions It is a value type, not a reference type. |
Beta Was this translation helpful? Give feedback.
Instead of
You need
Or
It is a value type, not a reference type.