Request timeout
Also called: timeout, request deadline, give up after N seconds.
The longest time the page or the server will wait for an answer before giving up. Without one, a stuck server can leave a spinner turning for minutes.
This server hangs and never answers. With a 3 s timeout the page stops waiting and says so. Without one it just keeps loading. Turn off “Server hangs” to see a normal fast answer.
Idle
Say it in a prompt
Give every call to GET /api/reports a 10 s timeout using AbortSignal.timeout(10000). When it times out, stop the spinner, show "This is taking longer than usual" with a Try again button, and log the endpoint and how long it waited. Seen on
- MDN Web Docs: AbortSignal.timeout() gives a signal that aborts a fetch after the time you set, failing with a TimeoutError.
- Stripe Node.js library: Its timeout option sets the most time each request may take; the default is 80000 ms.
You might describe it as
- loading forever and never finishing
- give up if the server doesn't answer in a few seconds
- stop waiting and show a try again message
Not to be confused with
- Retry with backoff
A timeout decides when to stop waiting; retry with backoff decides whether and when to try again.
- p99 latency
A timeout cuts one slow request off; p99 latency measures how slow the slowest 1% of requests are.