Hacker News new | ask | show | jobs
by mbesto 1437 days ago
Is there any way outside of just polling every 1~5 minutes to get realtime updates to RSS? Curious what is standard here? If you do do polling, what interval?
8 comments

I don't know if they are still in use, but there are pub/sub services that can be used for notifications.

This was created to avoid unnecessary polling of RSS/Atom feeds:

https://en.m.wikipedia.org/wiki/WebSub

Yes, you need to poll. Ideally with If-Modified-Since and If-None-Match headers so you can save some resources if the feed hasn't changed.
I usually do 60 minutes. I'm not desperate enough to check every 5 or 10 minutes. I've come across a few websites that block you if you refresh too frequently. I'm not sure whether those ones still do that though.
If you need realtime update, then RSS is probably not the right tool. For polling, I currently do the following:

* with `HTTP 304: not modified` result, I'll come back in 60 minutes * if there is any update, I'll come back in 4 hours * if there is no cache control header, such as etag or last-modified, I will poll every 12 hours.

Apart from websub, which does require some resources, servers could provide long-polling such that the socket remains open, and give a reply as soon as there is one. Clients don't poll, servers aren't flooded (but do need to keep an open connection )
WebSub (née PubSubHubbub) can work well if the RSS feed supports it.

https://en.wikipedia.org/wiki/WebSub

I poll every hour... for my need, that is plenty