Home / Companies / PubNub / Blog / Post Details
Content Deep Dive

What is Long Polling?

Blog post from PubNub

Post Details
Company
Date Published
Author
Developer Relations Team
Word Count
2,078
Company Posts That Month
20
Language
English
Hacker News Points
-
Post removed?
No
Summary

Long polling is a server push communication technique used to simulate real-time interaction over HTTP, particularly in web applications without WebSocket or HTTP/2 support. It involves the client sending a request to the server, which keeps the connection open until new data becomes available or a timeout occurs, after which the client immediately re-initiates the request cycle. This method is beneficial for responsive applications like chat apps and multiplayer games, as it reduces perceived request frequency and improves real-time data flow. However, long polling can incur HTTP overhead and requires robust error handling and optimization strategies, such as batching responses, compression, caching, and connection pooling, to enhance performance and scalability. While long polling shares similarities with WebSockets and Server-Sent Events (SSE), it differs in that it supports bidirectional communication and necessitates periodic reconnection. Various programming languages and frameworks, including JavaScript, PHP, Python, Ruby, Java, and .NET/C#, support long polling, and it can be further optimized using cloud-native solutions or services like PubNub, which abstracts scalability and infrastructure complexities.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 19 2,216 526 161 -9%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.