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

Flush just in-memory cache? #8

Open
sixten opened this issue Feb 17, 2012 · 1 comment
Open

Flush just in-memory cache? #8

sixten opened this issue Feb 17, 2012 · 1 comment

Comments

@sixten
Copy link

sixten commented Feb 17, 2012

The NSURLCache class provides a method by which one can dump the entire contents of the cache (-removeAllCachedResponses). What doesn't seem to be available, and would seem to be useful on iOS, would be a way to clear the contents of the in-memory cache, but not drop the items on disk. (The scenario being responding to a memory warning, where you need to free up storage, but clearing out disk space doesn't have any value.)

Seems like the implementation might be as simple as:

- (void)removeAllCachedResponsesInMemory {
    [super removeAllCachedResponses];
}

(With the obvious down side that if the Foundation implementation ever gains disk caching, this would be bad.)

@steipete
Copy link
Owner

Looks good. Can you make it a pull request?

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