Watch polling waste requests while SSE & WS stay on one connection.
POLLING
client asks every 2s
C
S
0
requests
0
empty
SSE
one connection, server pushes
C
S
0
connections
0
events
WEBSOCKET
both directions
C
S
0
connections
0
messages
SSE auto-reconnect + Last-Event-ID
Press Start — then drop the connection mid-stream
// event stream log…
Zero reconnection code needed
const src = new EventSource('/events'); src.onmessage = (e) => render(e.data); src.onerror = () => { // browser reconnects automatically // after ~3s, sending: // Last-Event-ID: 42 // server resumes from event 43 };
This is SSE's killer feature. On drop, the browser reconnects and sends Last-Event-ID with the last event it got. The server replays missed events — no lost data, no code on your side.
With WebSockets you build all of this yourself: detect the drop, reconnect with backoff, track message IDs, replay missed messages.