Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending expiration date for images in disk cache. #405

Closed
hifall opened this issue Aug 17, 2016 · 3 comments
Closed

Extending expiration date for images in disk cache. #405

hifall opened this issue Aug 17, 2016 · 3 comments

Comments

@hifall
Copy link

hifall commented Aug 17, 2016

Say I have dozens of images in disk cache. And my app uses some of them frequently, and doesn't want those to expire. How would I prevent Kingfisher from expiring them? More specifically, say:

1 I have 50 images cached in disk, and my app accesses 30 of them. By "accesses", I mean calling kf_setImageWithURL to supply the image;
2 I set up maxCachePeriodInSecond to be 7 days, with the intention that images not accessed in the last 7 days will be expired, and purged.

So in such a setting, would calling kf_setImageWithURL extend the image's expiration date to 7 days from the moment of calling? If not, what can I do to extend it?

Thanks!

@hifall
Copy link
Author

hifall commented Aug 17, 2016

Now I see your reply in #381.

You stated:
"Maybe we should use the access day instead of modification date to check the expiration. It might work better."

In all fairness, I agree with you on using something other than modification date to check for expiration. Using modification date doesn't seem all that elegant to me. After all, if the app keeps reading the image without modifying it, the image should be kept in cache for faster processing, right?

@onevcat
Copy link
Owner

onevcat commented Aug 17, 2016

Use access date instead of modification date. So, just access that image from disk will extend the expiration date for the same. Implemented in #406

@hifall
Copy link
Author

hifall commented Aug 17, 2016

WOW, can't believe this is happening so quickly. Amazing!

@onevcat onevcat closed this as completed Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants