@alex@social.alexwlchan.net Nice! Long polling for messaging like this has been formalised as Server-side Events for what it's worth - https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events

It lets you send various messages (like "reload me please") from the server with a nice event-based client-side API. This is how esbuild's Live Reload functionality works (https://esbuild.github.io/api/#live-reload)

new EventSource('/esbuild').addEventListener('change', () => location.reload())