Real-Time Delivery: Polling, Long Polling, SSE & WebSockets
When to reach for short polling, long polling, Server-Sent Events, or WebSockets — and how each handles reconnection and message ordering. Handshakes, headers, and trade-offs are checked against the specs (RFC 6455, WHATWG HTML) and verified in Node.
Questions
- Not answered. What distinguishes long polling from short polling?
- Not answered. Which browser API and response
Content-Typedefine Server-Sent Events? - Not answered. When
EventSourceauto-reconnects, which request header does it send so the server can resume the stream? - Not answered. A trading dashboard streams live price ticks to thousands of browser tabs; clients never send data back on this channel. Simplest robust fit?
- Not answered. Which statements about the WebSocket opening handshake are correct?
- Not answered. What HTTP status code does a server send to accept a WebSocket upgrade?
- Not answered. Which URI scheme does a WebSocket use when the connection is encrypted with TLS?
- Not answered. Why can naive long polling miss or reorder messages, and what is the standard fix?
- Not answered. Which of these are genuine limitations of Server-Sent Events?
- Not answered. You are building a collaborative document editor: many users send edits and receive others' edits with sub-second latency. Best transport?
- Not answered. At the protocol level, how does WebSocket keep an idle connection alive and detect a dead peer?
- Not answered. Out of the box, which protocol re-establishes a dropped connection on its own — no reconnection code from you?
- Not answered. How does serving Server-Sent Events over HTTP/2 (instead of HTTP/1.1) help?