Did you ever wonder why Apple’s own Demo App URLCache doesn’t use the NSURLCache class, but rather reimplements disk caching instead? Well, it looks like NSURLCache promises disk-caching, but doesn’t keep this promise.
Did you ever wonder why Apple’s own Demo App URLCache doesn’t use the NSURLCache class, but rather reimplements disk caching instead? Well, it looks like NSURLCache promises disk-caching, but doesn’t keep this promise.
Tags: cache, Cocoa, iPhone, NSURLCache, Objective C
Dieser Beitrag wurde am Juli 7, 2009, 2:08 pm unter Articles in english, development veröffentlicht. Du kannst allen Antworten zu diesem Beitrag durch RSS 2.0 folgen. Du kannst eine Antwort schreiben oder einen Trackback von deiner eigenen Seite hinterlassen.
Arclite Theme von digitalnature | powered by WordPress
#1 by Paul Lancefield on Februar 8, 2010 - 1:40 pm
Zitieren
Yep that’s true. The iPhone uses an in memory cache – which is kinda limited and won’t store to “disk” (flash memory). But UIWebView still checks the cache for these pages that can’t be stored. But this behaviour is good because
1) In memory caching is better than nothing.
2) You can override the shared cache class to change the behaviours and you could implement your own caching scheme if you really want to and it will then be used by UIWebView.
3) at any time in the future if the “disk” cache is enabled, UIWebView will get the benefit. So for example, on the iPad you may find “disk” caching enabled by default (I don’t know I haven’t checked – but it’s an example) in which case your iPhone apps will benefit from it when running on the iPad.