tags:

views:

14

answers:

1

Over at rsscache they have a way of refreshing the cache only when the feed has changed. Unfortunately its .Net.

I would like to know what approach I should take to achieve this in php.

How are changes in the feed detected? Simply by a timestamp (time node in the beginning of the feed)?

My feed would be a yahoo pipe that has mixed many feeds together. So either the yahoo feed must generate a combined timestamp, or my cache mechanism must automagically detect if the pipe has changed.

A: 

You have to:

  • Store when the content you have cache was last stored (read the server's Last-modified header).
  • Make conditional GET requests (send the header If-modified-since).

The server will either respond with 200 (OK) and the content or 304 (Not Modified) and an empty response body.

See RFC 2616.

Artefacto
detailed explenation;http://simplepie.org/wiki/faq/how_does_simplepie_s_caching_http_conditional_get_system_work
newnomad