Short Polling
Short polling is based on a timer and updates data at fixed intervals of time, it involves the client repeatedly sending requests to the server to check for new data
Long Polling
- A request is sent to the server.
- The server doesn’t close the connection until it has a message to send.
- When a message appears – the server responds to the request with it.
- The browser makes a new request immediately.
Long polling works great in situations when messages are rare.
- Used in JavaScript
- See also:Webhook, Websocket and Server Sent Events.