Hacker News new | ask | show | jobs
by cors-fls 1590 days ago
Thanks, I learned about Websub today. I love reading about all the "relatively new" web standards around decentralization.

If I understood correctly, one has to publish their topic so that others can sub through this hub ? Or can I use this hub with any publisher ?

Edit : after thinkin about it more, it could be that you publish for every change. The hub then validates the topic URL has changed to send an update.

3 comments

Generally what happens is a a publisher lets you know its available via a list of WebSub Hubs. Then as a subscriber, your client will pick one or all hubs available and send a request to the hub to get notifications about any updates. The hub then double checks with the subscriber that they'd like to see these updates and that's it until the publisher submits an update. When the publisher has an update, they poke the Hub, the hub downloads the content and shoots it out to all of the subscribers.

For the publisher, it's as easy as including

  Link: <https://hub.example.com/>; rel="hub"
  or 
  <link rel="hub" href="https://hub.example.com/">
in the header of the content.
> For the publisher, it’s as easy as including [a link element or header] in the header of the content.

Well, you’ve got to poke the hub as well when changes occur, which makes it moderately incompatible with static site generation, requiring some kind of manual action after you publish, which could be comparatively straightforward if you use a site generator that allows you to define programmable post-publish hooks, or could be difficult if it doesn’t and you publish to something that doesn’t guarantee instant updates.

Never heard of WebSub before! Does this have some relevance to RSS and/or all those new hip "federated" decentralized sites? Or is it some kind of protocol for event-driven service architectures? Something else? I found a W3C standard for it, but it'd be nice to have a higher-level explanation.
WebSub's biggest advantage from what I can tell is minimizing the load on the publishers. Instead of them having to manage webhooks to send out to, or having hundreds of thousands of clients polling them every minute, they can let a Hub do all the work for them.

Ably has a pretty good overview: https://ably.com/topic/websub (warning: sales article)

WebSub isn't that new actually, it was originally called PubSubHubbub and the first spec version was written in 2009.