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

get cache created at NSDate #23

Open
prabirshrestha opened this issue Nov 12, 2012 · 0 comments
Open

get cache created at NSDate #23

prabirshrestha opened this issue Nov 12, 2012 · 0 comments

Comments

@prabirshrestha
Copy link

add a method that allows to get the date when the cache was created.

- (NSDate*) getCreatedAt:(NSString*)key;

It will then allow to use this logic.

if has cachedData
    load from cachedData
    if cachedCreateDate is old
        fetch online, cache it and reload
else
    fetch online, cache it and load

I want to set the cache as long as possible, but if it is old I would like to load from cache and fetch online too.

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

1 participant