Re: Caching a local file using NSURLCache

2008-04-26 Thread Michael Vannorsdel
I believe it would be more difficult to implement true support for a file protocol in an NSURLCache subclass than to maintain your own dictionary that's saved and read from your own cache file. I don't know of any documentation on the cache file format that NSURLCache uses, I just know it'

Re: Caching a local file using NSURLCache

2008-04-25 Thread Stephan Burlot
I was 100% sure the doc stated that NSURLCache handled file://, and since it worked under 10.4, I didnt look further. But I just found only http and https are cached. I didnt want a cache for local file: in my app, I display files which are located locally and remotely. In addition, the loc

Re: Caching a local file using NSURLCache

2008-04-24 Thread Jens Alfke
On 23 Apr '08, at 3:14 PM, Stephan Burlot wrote: I want to cache local files (images) so I cache a NSData using [NSURLCache storeCachedResponse] If I try to fetch it, the cachedResponseForRequest:request is always nil under 10.5 This works under 10.4. NSURLCache was rewritten in 10.5; the

Re: Caching a local file using NSURLCache

2008-04-24 Thread Michael Vannorsdel
As far as I know NSURLCache only works for HTTP/HTTPS without extending the class yourself for other protocols. I think you might do better just using a mutable dictionary and saving that to disc with your data objects. The key would be your URL. On Apr 23, 2008, at 4:14 PM, Stephan Burl

Caching a local file using NSURLCache

2008-04-23 Thread Stephan Burlot
Hi, I want to cache local files (images) so I cache a NSData using [NSURLCache storeCachedResponse] If I try to fetch it, the cachedResponseForRequest:request is always nil under 10.5 This works under 10.4. I tried to create my own sharedURLCache, but it still doesn't work. I use NSStr