RealComposer
Architecture & BFF

Long Polling

Direct Definition

Long polling is a technique where the client sends an HTTP request and the server holds the connection open until new data is available or a timeout occurs, then the client immediately opens the next request. It simulates server push over plain HTTP.

Technical Architecture & Deep-Dive

Short polling wastes requests: the client asks every few seconds whether anything changed. Long polling reduces empty responses by waiting on the server until an event arrives or a keep-alive window expires.

Long polling works through corporate proxies and older browsers that block WebSockets, but it ties up server threads and scales poorly under many concurrent waiters. Teams often migrate to WebSockets or webhooks for production traffic, using an edge BFF to unify authentication while clients still speak simple HTTP.

Key Architectural Benefits

Adds near-real-time updates without WebSocket support on every client.
Uses familiar HTTP semantics and firewall-friendly ports.
Acts as a stepping stone from short polling toward event-driven designs.
REALCOMPOSER EDGE WORKSPACE

Implement Long Polling at the Edge

Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.

START BUILDING FREE

Frequently Asked Questions

Q:How is long polling different from server-sent events?

Server-sent events keep one long-lived connection for one-way server push. Long polling completes each request after data arrives and opens a new one, mimicking push with standard request-response cycles.

Related Architecture Concepts

Ready-to-Use Edge Recipes