Long Polling

Description: Long Polling is a web application development pattern that allows emulating the sending of data from the server to the client more efficiently than traditional polling. In this approach, the client makes an HTTP request to the server and, instead of receiving an immediate response, the server keeps the connection open until new data is available or a timeout is reached. Once the data is sent, the client can make another request to continue the process. This method is particularly useful in applications where real-time updates are crucial, such as online chats, real-time notifications, or event tracking systems. Unlike short polling, where the client queries the server at regular intervals, long polling reduces server load and improves network efficiency by minimizing unnecessary requests. Although not as efficient as more modern technologies like WebSockets, long polling remains a viable option in situations where these technologies are unavailable or difficult to implement.

History: The concept of long polling emerged in the late 1990s and early 2000s when web applications began to require real-time updates. With the rise of interactivity on the web, developers sought ways to improve communication between the client and server. Although traditional polling was an option, its inefficiency led to the adoption of long polling as an intermediate solution before the advent of more advanced technologies like WebSockets in 2011.

Uses: Long polling is primarily used in applications that require real-time updates, such as online chats, real-time notifications, and event tracking systems. It is also useful in situations where persistent connections are not feasible or where compatibility with older browsers that do not support more modern technologies is needed.

Examples: An example of long polling usage is in instant messaging applications, where the client sends a request to the server and waits until new messages are available. Another case is in sports event tracking applications, where users want to receive real-time updates on the status of a game.

  • Rating:
  • 1
  • (1)

Deja tu comentario

Your email address will not be published. Required fields are marked *

Glosarix on your device

Install
×
Enable Notifications Ok No