Apple's NSURLCache
class has decent documentation, but it doesn't say what caching algorithm it uses. Is it LRU, LFU, or something else entirely?
I'm developing for the iPad, and am hoping to make use of NSURLCache
's disk-caching abilities to cache photos, by using [NSURLCache setDiskCapacity]
(the default seems to be 0). What's the upper limit on this value?
The NSURLCache class implements the caching of responses to URL load requests, by mapping NSURLRequest objects to NSCachedURLResponse objects. It provides a composite in-memory and on-disk cache, and lets you manipulate the sizes of both the in-memory and on-disk portions.
A mutable collection you use to temporarily store transient key-value pairs that are subject to eviction when resources are low.
The upper limit on the disk capacity seems to be the disk capacity of the device. I can't see anything about a 'software imposed' limit.
As for the caching algorithm, there doesn't seem to be any apple provided documentation but I did find this. It's not strictly what you asked for, but it certainly gives you an insight into what's going on. I believe this one to be using a Multi Queue Caching Algorithm (?) where it's sorted by size and then by least recently used.
If you were making something dependant on knowing the caching algorithm, you could do some thing with this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With