FROM : Jim Correia
DATE : Thu Feb 07 15:12:47 2008
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
DATE : Thu Feb 07 15:12:47 2008
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
| Related mails | Author | Date |
|---|---|---|
| Matthew Delves | Feb 7, 06:47 | |
| Nick Zitzmann | Feb 7, 07:49 | |
| Matthew Delves | Feb 7, 08:17 | |
| Nick Zitzmann | Feb 7, 08:50 | |
| Nir Soffer | Feb 7, 09:17 | |
| Byron Wright | Feb 7, 09:46 | |
| Matthew Delves | Feb 7, 10:41 | |
| Jim Correia | Feb 7, 15:12 |






Cocoa mail archive

