Long Polling Pattern
ELI5 — The Vibe Check
Long Polling is polling's smarter cousin. Instead of asking 'any updates?' every 5 seconds, the client asks and the server HOLDS the connection open until there's actually something to say. Then the client immediately reconnects. Less wasteful than polling, works everywhere, simpler than WebSockets.
Real Talk
Long polling is a technique where the client sends a request and the server holds it open until new data is available or a timeout occurs. Upon receiving a response, the client immediately sends a new request. It provides near-real-time updates over standard HTTP without WebSocket infrastructure.
When You'll Hear This
"Long polling gives us real-time-ish updates without WebSocket infrastructure." / "We use long polling as a fallback when WebSocket connections fail."
Related Terms
Polling
Polling is the 'are we there yet?' of web development. Your client keeps asking the server 'any updates? any updates? any updates?' at regular intervals.
Server-Sent Events Pattern
Server-Sent Events (SSE) is a one-way stream from server to browser over plain HTTP. The server pushes updates, the client just listens.
WebSocket
WebSocket is like upgrading a walkie-talkie from push-to-talk to a full phone call.