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
Not clear expired content on CacheManager init #116
Comments
@jlsandrin hey man, right now we don't have a way of opting out from clearing the expired objects when |
This feels pseudo related to #117. |
@vadymmarkov could this be solved by adding a small configuration enum. enum CacheExpirationMode {
case auto, manual
}
|
@zenangst Yes, that should work I think. |
I agree with clearing objects on init. I personally prefer an option like that, but unfortunately this app can't work this way. The problem with setting the expiration to nil is that I can't handle if content is "old" or not (or at least I couldn't find a way). I download something new whenever expiration date is older than current date, while not deleting what is in store.
|
@jlsandrin ohai, I whipped up a small PR to implement this feature, you can find it here #118 |
Awesome, you guys rock! |
@jlsandrin let us know how it works out! It should be on |
I'm using Cache to store JSON coming from the server. This content is updated everyday, so I'm setting it's expiration date to be the day it was downloaded at 11:59 PM. this works just fine and the content is expired and re downloaded the next day.
The problem I'm facing is that, due to business rules, I need to return expired content (so I can have something to show user), identify that this content has expired and download the new version. And then update view with this new content and cache it.
Is there any way to flag Cache to not clear expired data on initialization, and when receiving some notifications?
The text was updated successfully, but these errors were encountered: