Hacker News new | ask | show | jobs
by gfodor 897 days ago
At the time I wrote this library using websockets on Cloudflare would have been prohibitively expensive compared to this polling method. Has that changed?
2 comments

From my understanding, yes. I asked about the billing model on the CF Discord 6-12? months ago. I don't know how much it costs per message, or if there is a catch wrt cheap wrtc signalling, however my understanding is that you won't be paying per user or per hour etc. To be clear this is through their MQTT 5.0 service only.
Yes, in the last year Durable Objects introduced "hibernation", in which the server object can shut down with WebSocket connections still active, to be started back up when a new message arrives. This largely solves cost issues with WebSockets on Workers / DO.
Yeah this might be a better solution now for sure.
I think it'll work pretty well! I might keep something cloud portable cooking away in the background.