Long polling is a method of maintaining a connection with the server for an extended period of time. The client queries the server for fresh information in extended polling. A client’s connection is kept open for as long as feasible by the server. Only when the data has been delivered back to the client or a connection timeout has occurred is the connection terminated.
Long Polling Flow:
- The server receives a request.
- A client’s connection is held by the server until new data is available.
- When new information becomes available, the server answers the request.
- The browser makes a new request right away.