Back to the Catalog
real-time
websockets
networking
http

Real-Time Delivery: Polling, Long Polling, SSE & WebSockets

13 questions

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

  1. Not answered. What distinguishes long polling from short polling?
  2. Not answered. Which browser API and response Content-Type define Server-Sent Events?
  3. Not answered. When EventSource auto-reconnects, which request header does it send so the server can resume the stream?
  4. 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?
  5. Not answered. Which statements about the WebSocket opening handshake are correct?
  6. Not answered. What HTTP status code does a server send to accept a WebSocket upgrade?
  7. Not answered. Which URI scheme does a WebSocket use when the connection is encrypted with TLS?
  8. Not answered. Why can naive long polling miss or reorder messages, and what is the standard fix?
  9. Not answered. Which of these are genuine limitations of Server-Sent Events?
  10. Not answered. You are building a collaborative document editor: many users send edits and receive others' edits with sub-second latency. Best transport?
  11. Not answered. At the protocol level, how does WebSocket keep an idle connection alive and detect a dead peer?
  12. Not answered. Out of the box, which protocol re-establishes a dropped connection on its own — no reconnection code from you?
  13. Not answered. How does serving Server-Sent Events over HTTP/2 (instead of HTTP/1.1) help?