Long polling vs short polling: what's the difference?
Short polling asks on a timer and gets an instant answer; long polling holds each request open until there's news or a timeout, then asks again.

Short polling sends a request on a timer, and the server answers at once, even when nothing has changed. Long polling sends a request that the server holds open until there is news or a timeout, and the client typically asks again as soon as it gets the answer. Long polling aims to cut delivery delay and wasted requests; the price is a request held open per client, kept short enough to end before proxy timeouts do.
The definitions come from RFC 6202, the IETF's informational RFC on long polling, and MDN's WebSocket API and Server-sent events pages. The Sume waits come from its Jobs and results and Authentication docs. All were read on 2026-09-28.
How does long polling differ from short polling?
In short polling, each request pulls whatever is available. If nothing is, the server returns an empty response and the client waits before polling again. How often you poll depends on how much delay you can tolerate, and a low tolerance means many requests. In long polling, the server responds only when an event, a status change or a timeout occurs. The client typically sends a new long poll right away, so the server almost always holds one open.
| Short polling | Long polling | |
|---|---|---|
| When the server answers | At once, with an empty response if nothing is new | When an event, a status change or a timeout occurs |
| Delay before you hear news | Set by how often you poll | Close to one network transit on average, over three at worst |
| Cost | Server and network load grow as you poll more often | A TCP connection and an HTTP request held open per client |
| Timeouts | Each request returns at once | The held request must end before proxy and server timeouts do |
What are the downsides of long polling?
RFC 6202 describes these costs:
- Held resources. Each waiting client holds a TCP connection and an HTTP request open, and some gateways, proxies and servers limit how many requests can be outstanding.
- Timeouts in the middle. Hold a request too long and the client may get a
408 Request Timeoutfrom the server or a504 Gateway Timeoutfrom a proxy. The RFC reports success with timeouts as high as 120 seconds, but calls 30 seconds generally a safer value. - Header overhead. Every long poll request and response is a complete HTTP message with a full set of headers, which can be a large share of the data for small, infrequent messages.
- Worst-case delay. News that arrives just after a response has to wait for the next request.
Which should I use for a job that takes minutes?
Neither holds one request that long. RFC 6202 calls 30 seconds a generally safer long-poll timeout, so a wait of minutes becomes a series of requests: short polls spaced out with backoff, or long polls repeated one after another. A server can also skip waiting and take a webhook. Sume's API offers each, with its own limit; image jobs often finish inside its 30-second submit wait, and video jobs routinely do not.
- Short polls: read
GET /v1/jobs/{id}/status, sleepingnext_poll_after_secondswhen it's present or backing off exponentially, untilterminalis true. Reads have their own budget, forty times the write budget, so a tight status-poll loop can't 429 your own submits. How to poll a video generation job status API shows the loop. - A bounded wait on the submit: on routes that take a
mode,mode: "sync", or its aliassubscribe, holds the create for at most 30 seconds, and less when waiter capacity is unavailable. Not terminal by then? Poll; don't resubmit. Sync vs async lists the routes that differ. - Repeated long polls: the hosted MCP
jobs_waitholds one call for at most 55 seconds, 50 by default. The docs say every edge eventually closes a request held open with nothing transferring, so wait out a ten-minute render by repeating the wait, not by asking for a longer one. See MCP tool call timeouts. - A webhook: skip waiting and let Sume POST the terminal event to your server, as in Webhook vs API.
What about WebSockets and server-sent events?
Both let the server send news without waiting to be polled. A WebSocket is a two-way session in which the browser can send messages and receive responses without polling for a reply. Server-sent events let a server push new data to a web page at any time. Sume's Developer API offers neither today, and its GET /v1/jobs/:id/events is a pull snapshot, not a stream; React Query polling shows how a browser page waits instead.
Sources
Related posts
More in Developers
- MCP error codes: what -32601, -32602, and -32001 mean
MCP error codes are JSON-RPC codes. What -32700 to -32603 mean, why -32001 is a client-side timeout, and how a failed tool call differs from both.
- MCP JSON config: what's in mcp.json and why clients differ
An MCP JSON config lists servers by name: a command for local ones, a URL and headers for remote ones. Why the key names differ between clients.
- MCP server API key vs OAuth: which one to use
Use OAuth when a person signs in from Claude, Cursor, or another client; use an API key header for scripts, CI, and headless runs with no browser.
- MCP server file upload: how a local file reaches a tool
A remote MCP server can't read your disk. A tool gets only the arguments your client sends, so the file must sit at a URL the tool accepts.
Written by Sume