Glossary

Long Polling

Long polling is a technique for simulating push notifications over HTTP. The client sends a request; the server holds it open until new data appears (or a timeout occurs), then responds. The client immediately sends the next request. An older "real-time" approach before WebSocket.

Flow

Client                    Server
  |-- GET /poll --------->|
  |                       | (waiting for new data)
  |                       | (30 seconds...)
  |<-- 200 {data} --------|
  |-- GET /poll --------->| (new request immediately)
  |                       |

Benefits

Drawbacks

When still relevant

Environments where WebSocket and SSE are unavailable (corporate proxies, old browsers). In modern web apps, usually replaced by SSE or WebSocket.