Pushing RSS Feeds

RSS is a classic example of a technology which relies on the client pulling data from the server, rather than the server pushing data to the client. While pull is simpler to implement, it requires the client to periodically poll the server for new content to pull. Unless you poll the server continuously, you’ll never get new data in realtime.

This is a common problem for RSS feed readers – how do you balance the requirement for getting new articles in a timely fashion versus not wasting resources communicating when no updates have happened? The answer for most RSS feed readers to to build up information about the frequency of posts to that feed and then pull at a suitable interval. NewsBlur is one site that follows this methodology, the screenshot below shows how often NewsBlur fetches the feed for this blog and why;

NewsBlur's fetch interval for this blog.

NewsBlur’s fetch interval for this blog.

As can be seen, because so few posts are made (I should really resolve that), the feed is only fetched 7 to 9 days. So in the worst case scenario, someone who subscribes to this blog may only be notified of a new article by there reader 9 days after it was originally posted. If there was some way that this blog could push a notification to the RSS feed reader that a new article had been posted though, then the delay between posting a new article and being notified of it could be dramatically reduced.

Enter PubSubHubbub – a protocol which uses the publish/subscribe architecture for notifying feed subscribers when a new article has been published to a feed. The PubSubHubbub Google Code Page has lots of information on implementing both the publish and subscribe sides of the protocol. However, if you’re using a popular blogging platform such as WordPress, then you can easily implement it via plugins which have been already developed.

After installing a PubSubHubbub plugin on this blog, NewsBlur’s fetch interval changes to the following;

Fetch interval for this blog with PubSubHubbub implemented.

NewsBlur’s fetch interval for this blog with PubSubHubbub implemented.

While the feed is still periodically fetched at certain intervals as per NewsBlur’s previous algorithm, it also receives any realtime updates, significantly reducing the timelag between me publishing this post and it appearing in RSS feed readers. Hurrah!

Leave a Reply

Your email address will not be published. Required fields are marked *