• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Caching a local file using NSURLCache
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caching a local file using NSURLCache


  • Subject: Re: Caching a local file using NSURLCache
  • From: Stephan Burlot <email@hidden>
  • Date: Fri, 25 Apr 2008 23:26:55 +0200

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 local files are reduced for display, so using an unified cache for remote and local did simplify a lot my code. Unfortunately, I have to rewrite it.

The doc says that file:// caching can be done "Custom NSURLProtocol classes can provide caching if they choose."

If anyone has some sample NSURLProtocol code to share, I didnt found any example that I can use.

Thanks,
Stephan



Le 24 avr. 08 à 20:42, Jens Alfke a écrit :


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 new implementation probably ignores file: URLs, because it doesn't make sense to use the filesystem to cache data from the filesystem.


Are you sure you need to be using a cache to store local files? Why can't you just reload the image from its original source file if you need to? If you really need to do this, you'll need to make your own implementation, I think.

—jens

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Caching a local file using NSURLCache
      • From: Michael Vannorsdel <email@hidden>
References: 
 >Caching a local file using NSURLCache (From: Stephan Burlot <email@hidden>)
 >Re: Caching a local file using NSURLCache (From: Jens Alfke <email@hidden>)

  • Prev by Date: iphone document syncing
  • Next by Date: Re: Framework for IB Plugin and app
  • Previous by thread: Re: Caching a local file using NSURLCache
  • Next by thread: Re: Caching a local file using NSURLCache
  • Index(es):
    • Date
    • Thread