0% completed
Difference Between Long-Polling, WebSockets, and Server-Sent Events
Long-Polling, WebSockets, and Server-Sent Events all solve the same problem: getting updates from the server to the client without refreshing the page. They just solve it in three different ways. Here is each one in a single sentence:
- Long-Polling: the client asks, and the server holds the request open until it has data to send. After every answer, the client asks again.
.....
.....
.....
heybenross
· 3 years ago
When should each be used? What are the pros and cons of each?
dominikcubic
· 2 years ago
In this description of AJAX polling, is the "requested webpage" the same as the "Client"?
- Client requests data from a server using regular HTTP.
- The requested webpage opens a connection to the server.
- The server sends the data to the client whenever there's new information available.
Vu Tong
· 3 months ago
It's worth to mention that to avoid performance impact, the server should have some kind of asynchronous processing for incoming requests. If the server uses a traditional thread-per-request model and every client holds a long-lived connection, that will hurt the overall performance.