steipete/SDURLCache — Issue #8: Flush just in-memory cache?
Author: sixten
Created: 2012-02-17 00:18:55+00:00
State: open

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.)