Cache expiration issue? #2071
-
| 
         Is it expected behaviour that expiration for an image is postponed every time it's requested? Example: 
 Is this intended behaviour? My real life problem is that I have images that rarely change, so the default expiration time of 7 days seems perfect. However, because the image is retrieved (from Kingfisher) on a daily basis it seems like the image never expires, which causes a potential updated image (on the server) to never get fetched - unless the user doesn't use the app for more than 7 days. Thanks.  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
        
 Yes. It is intended. Kingfisher goes to a "refresh when read" way when determine a disk cache should be expired or not. To change this behavior, try  KF.url(url)
  .diskCacheAccessExtending(.none)
  .set(to: imageView)
// Or this if you prefer the classical way
imageView.kf.setImage(with: url, options: [.diskCacheAccessExtendingExpiration(.none)])For its reference, check it here if you want to know more.  | 
  
Beta Was this translation helpful? Give feedback.
Yes. It is intended. Kingfisher goes to a "refresh when read" way when determine a disk cache should be expired or not.
To change this behavior, try
.diskCacheAccessExtending, such as:For its reference, check it here if you want to know more.