DEV Community

Padmesh
Padmesh

Posted on

Short Polling & Long Polling Concepts

Polling is a communication method where client repeatedly sends request to the server to check if any data is available

It has 2 methods :

  • Long Polling
  • Short Polling

Both methods allow a client to receive updates from a server but they differ significantly in performance and resource usage

Short Polling :

  1. When a client sends request to the server repeatedly in a fixed interval of time until it gets the desired response its called Short Polling
  2. It increases the load of the server if the client sends requests in a very short period of time interval
  3. Therefore Long Polling is prefered over Short Polling

Long Polling :

  1. When a client sends a request and the server waits for the data to get ready to be sent as response to the client is called Long Polling
  2. It will decrease the server load completely
  3. Since it stays connected to a client till the response is ready every request will occupy a port and ports are limited

Top comments (0)