views:

25

answers:

2

Over at rsscache they offer a mechanism that caches your website's feed. They claim that if a new node gets added to your feed, instead of flushing and refilling the entire cache(for the current user, they proably do for new users), they only send the new node to the current users newsreader, and the reader adds it within the other nodes, it updates without completely refreshing, saving bandwidth. (see step 6)

Is this correct, I can imagine the cache having a node added, rather then flushed and renewed, but I don't get how this scenario could work in the visitor's feedreader.

If so how can it (selective update to cache and or reader) be achieved with php?

Could this selective node update-mechanism be extended to exclude error nodes, like;

error:node not found

So when random nodes in the mashup feed (lifestream) originating from a specific service, ea twitter, dissapear because the servide is offline, the nodes dont get replaced with the offline error, but their previous state sticks?

A: 

Normally feedreaders keep all items ever included in a feed. Or let you configure the maximum age or number of items to keep.

Rsscache.com probably stores the items of a feed and which clients have received which items is a database. With that information it's possible to dynamically create a feed with only items not returned yet.

So when you start reading a feed through rsscache.com all items are returned but in later requests only the new items.

Kwebble
A: 

Here's one approach that might work :

Keep a local cache of the feeds, and do conditional GETs (using If-Modified-Since header) based on the date of this cached version (resulting in less bandwidth for the webmaster IF his server supports conditional GETs). Once you have the feed check every item in it to see if it already exists in your DB or not. If it already exists, skip it, if it doesn't then add it including a timestamp to reflect when you added it, and you probably want to remove "dead" items for the feed as well.

Now you need to keep track of the last time someone queried a specific feed on the server. If it's the first time someone asks for a feed, then just return all items you stored in the DB for that feed, and add a record containing user (ip?), feed and the current time. If he's been there before for that feed then select all records for that feed that have been added after his previous query (and afterwards update the last_query time for that specific user and feed to the current time). And if there are no new items simply return an empty feed.

wimvds