开发者

Cache feed and only refresh when feed is changed

Over at rsscache they have a way of refreshing the cache onl开发者_如何学运维y 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜