How to Get Server Response Time Right
How long the server takes to produce the first byte of a response, which sets the floor for every other timing metric.
The key figures
- Metric
- Time to First Byte
- Guidance
- web.dev suggests keeping it low as a general target rather than as a threshold
- Contributors
- server processing, database queries, network latency and redirects
- Redirects
- each one adds a full round trip
- Caching
- the most effective single remedy
Why this is worth getting right
No amount of front-end optimization recovers a slow server response, because nothing can start until the response begins.
Do this, not that
Do
- Profile server processing before optimizing the front end
- Cache expensive responses and expensive queries
- Eliminate redirect chains on entry URLs
- Reduce distance with a CDN or regional hosting
- Monitor response time as a continuous measure
Don’t
- Front-end optimization while the server takes seconds to respond
- Redirect chains on the most requested URLs
- Uncached expensive database queries on popular pages
- Hosting far from the audience with no CDN
When to bring in help
Our advice Bring in help when response times are slow and the cause is not obvious, when a platform limits what can be optimized, or when load causes response times to collapse.
Where this comes from
- web.dev — Time to First Byte
- MDN Web Docs — HTTP performance
- Cloudflare Learning Center — Latency and TTFB
The figures and practices above come from the sources listed.
Working on something like this?
We take on Performance & Accessibility work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.