Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Neither Server-Sent Events nor WebSockets have replaced all use cases of long polling reliably. The connection limit of SSE comes up a lot, even if you’re using HTTP/2. WebSockets, on the other hand, are unreliable as hell in most environments. Also, WS is hard to debug, and many of our prod issues with WS couldn’t even be reproduced locally.

Detecting changes in the backend and propagating them to the right client is still an unsolved problem. Until then, long polling is surprisingly simple and a robust solution that works.



Robust WS solutions need a fallback anyway, and unless you are doing something like Discord long polling is a reasonable option.


> The connection limit of SSE comes up a lot, even if you’re using HTTP/2.

I'm considering using SSE for an app. I'm curious, what problems you've run into? At least the docs say you get 100 connections between the server and a client, but it can be negotiated higher if needed it seems?

https://developer.mozilla.org/en-US/docs/Web/API/EventSource


SSEs are great and more reliable than websockets in a smaller scale. So I'd reach for it despite the issues. But that being said, some websevers don't play well with SSE and you'll need to fiddle with it. If you control the webserver, then it's not much of a problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: