This is still the header! Main site

RSS and Polling

2021/12/20

... two things I didn't think a lot about before.

This is post no. 55 for Kev Quirk's #100DaysToOffload challenge. The point is to write many things, not to write good ones. Please adjust quality expectations accordingly :)

Isn't polling stupid?

So, to check whether someone has posted a new blog post on their site... you just ask their server for their RSS feed document. You do this, say, every hour. Continuously.

Together with the fact that there seems to be actual demand for putting all the content on your site into the feed XML document (and not just summaries)... it sounds like a lot of overhead.

In practice though, web servers tend to return 304 Not Modified if nothing actually changed, so we can get away with a smaller response. On the other hand... it's... still not an overly reasonable-sounding notification mechanism.

... until you realize that it isn't really intended as a real-time notification mechanism.

Really Simple Syndication

The word "syndication" in (one of) the expansion(s) of RSS refers to what the original use case actually was: to include contents from a site on another site.

E.g. if you have a web portal (yes, those were a thing at some point), a section of it can include a set of headlines from a news site. In such a scenario, the portal web server can fetch the RSS feed XML of the news site; even if the portal side does no caching whatsoever, it's still better than the user fetching the front page of both sites separately. Meanwhile, if there is no traffic at all, no repeated fetching of the feed is necessary.

In fact, even if we do queries not as a portal but for each user separately (... as it is often the case these days), this model still works reasonably well if feeds only get queried once the user opens up an RSS reader app. You don't even need polling if you don't particularly care about real-time notifications. Or... loading times; of course it helps to have everything pre-cached and warmed up. Thus the polling.

There is even a solution for that

It's called WebSub, and it's a surprisingly generic protocol to keep track of updates. Basically, you can put a link to a hub into your RSS feed / HTML document / etc; they can then ask the hub to notify them once the content changes. When e.g. a new feed item is added, the generator of the feed notifies the hub, which then hands out updates to all the subscribers, instantly, without the need of polling.

Well, it actually does this via webhooks, so it does help a lot if the RSS reader is also something that has a public URI and open ports (and not, say, a mobile client). Also, it's somewhat unclear how many sites and / or consumers actually support this. But, in theory, it exists!

... comments welcome, either in email or on the (eventual) Mastodon post on Fosstodon.