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

Half-OT:

What's the most resource efficient way to push data to clients over HTTP?

I can send data to a server via HTTP request, I just need a way to notify a client about a change and would like to avoid polling for it.

I heard talk about SSE, WebSockets, and now long-polling.

Is there something else?

What requires the least resources on the server?



I don't think any of the methods give any significant advantage since in the end you need to maintain a connection per each client. The difference between the methods boils down to complexity of implementation and reliability.

If you want to reduce server load then you'd have to sacrifice responsiveness, e.g. you perform short polls at certain intervals, say 10s.


Okay, thanks.

What's the least complex to implement then?


For the browser and if you need only server-to-client sends, I assume SSE would be the best option.

For other clients, such as mobile apps, I think long poll would be the simplest.




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

Search: