Re: Determining if a url exists
Re: Determining if a url exists
- Subject: Re: Determining if a url exists
- From: Jim Correia <email@hidden>
- Date: Thu, 7 Feb 2008 09:12:47 -0500
On Feb 7, 2008, at 4:41 AM, Matthew Delves wrote:
On 07/02/2008, at 7:46 PM, Byron Wright wrote:
Just curious, why try and get around caching? Caching is usually
there for good reason. For example a 304 would mean "not
modified" (use your cache instead) so you can usually depend on the
data you have stored locally.
I'm dealing with RSS feeds predominately. Whilst I would like to use
Caching as much as possible, I have unfortunately run into the
problem of knowing that a feed has been updated (ie, I opened it in
Firefox) though unable to see the updated feed in my app.
Without more information (the URL, the response headers, etc.) it is
not possible to tell. It may be that this is the correct behavior.
If you know of a better way to handle this, it would be much
appreciated.
The way in which I'm getting the rss feeds is by calling
NSXMLDocument initWithContentsOfURL: options: error:
Modifying the URL to defeat the caching mechanism is not a good
solution (as you have found out.)
In general, you should be using the cache to your advantage rather
than trying to fight it. If you have a specific need to customize the
fetch behavior, you'll have to download the data directly using the
Foundation URL subsystem, and then create an XML document from the
downloaded data. When using the URL subsystem directly, you can set
the cache policy on your NSURLRequest.
Jim
_______________________________________________
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