What is Long Polling?

Turkish: Long Polling

Long polling keeps an HTTP request open until the server has new data, giving clients near real-time updates without a persistent socket.

What is Long Polling?

Long polling is a more efficient version of repeatedly asking a server for updates. The client opens an HTTP request; instead of returning an empty response immediately, the server holds that request until an event, message, or state change is available.

How Does It Work?

  1. A browser or mobile app opens an HTTP request.
  2. The server waits if there is no new data.
  3. The server responds when data appears or a timeout is reached.
  4. The client processes the response and immediately opens the next long polling request.

Because it uses standard HTTP, long polling can be easier to deploy in older proxy or corporate network environments than WebSocket. The tradeoff is that every response is followed by another request, so connection limits, timeouts, and server resource usage need careful tuning at scale.

When Is It Used?

Long polling fits low-to-medium volume real-time needs such as order status updates, notification panels, background report completion, or delayed support messages. If a one-way stream is enough, SSE may be simpler. If the application needs heavy two-way communication, WebSocket is usually the better fit.