Skip navigation.
 
ml(no subject)
FROM : Mark Meyer
DATE : Thu Dec 02 22:49:35 2004

I'm trying to get the various NSURL*** classes to always cache data so
I can get to it later. From reading the docs, one would think that the
NSURLCache would be pretty helpful here, but I can't seem to get it to
work with me. There are all sorts of provisions in the URL downloading
classes to prevent one from getting stale data, but what do you suggest
if your would prefer stale data? Do you need to allocate a new
NSURLCache instead of using the shared one?

I imagine it would be easy enough to use NSURLDownload, save the info
to disk and go from there, but as long as the URL classes are caching
some of the data anyway, and it seems to be pretty efficient, I sure
would like to use it.

I've tried various incarnations of this: [[NSURLCache sharedURLCache]
storeCachedResponse:cachedResponse forRequest:URLRequest]; with no
luck. It seems like it is still only caching what it wants to based on 
the http headers.

Any suggestions on changing the policy so *everything* gets cached
regardless of what the server says should happen? Or is this the
totally wrong approach if one wants to hang on to the received data for
later use in the application?

Thanks

Related mailsAuthorDate
ml(no subject) Michael A. Crawfor… Nov 27, 05:20
mlRe: (no subject) Fritz Anderson Nov 27, 22:58
ml(no subject) Mark Meyer Dec 2, 22:49
mlRe: (no subject) Jeremy French Dec 3, 16:21
ml(no subject) Michael Swan Dec 5, 00:04