Glossary
Time to first byte
Time to first byte measures the interval between a request being initiated and the first byte of the response arriving. It covers everything before any rendering can begin: redirects, DNS resolution, connection setup, the TLS handshake, and the server's own processing time. Because every other loading metric waits on it, a high value puts a floor under all of them that no front-end work can lift.
What the interval contains
Redirect time, if the navigation went through one or more redirects. Each is a full round trip plus a server response.
DNS resolution, which is near zero when cached and can be substantial on a cold lookup.
TCP connection setup, one round trip, and the TLS handshake, one more on TLS 1.3.
The request travelling to the server, the server's processing, and the first byte travelling back.
Breaking these apart is what separates a network problem from a server problem, and a single total conceals which it is.
What it does not include
Downloading the rest of the response. A large HTML document with a fast first byte still takes time to arrive.
Parsing, rendering and script execution, all of which happen afterwards.
Subresource loading, which begins only once the browser has parsed enough HTML to discover the references.
So a good time to first byte is a precondition for a fast page, not evidence of one.
It also says nothing about correctness: a server that answers a 500 in 50 milliseconds has an excellent time to first byte and has served nothing.
What a high value usually means
Server-side processing: database queries without indexes, external API calls in the request path, template rendering that repeats work per request.
No caching. A page that could be served from cache and is instead regenerated per request pays the full cost every time.
Geographic distance, where every request crosses an ocean to reach a single origin. This is the case a content delivery network addresses directly.
Redirects. A chain of three redirects can easily add several hundred milliseconds before the real request even begins.
Cold starts on serverless platforms, where the first request after an idle period pays for the runtime being started.
How to measure it
`curl -w "dns:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} ttfb:%{time_starttransfer}\n" -o /dev/null -s https://example.com` prints the phases separately.
Run it several times. The first measurement includes a cold DNS lookup and connection, and the difference between the first and subsequent runs is itself informative.
The browser's network panel shows the same breakdown per request, with waiting time separated from transfer time.
Field data reports it across real visits, which captures the geographic spread a single measurement from one location cannot.
Measure a cacheable page and an uncacheable one separately. A site that looks fast on its home page and slow on a search result is describing its caching, and a single figure averages the two into something that describes neither.
Frequently asked questions
- What is a good time to first byte?
- web.dev suggests 800 milliseconds or less as a target at the 75th percentile, with above 1.8 seconds classified as poor.
- Does a CDN improve time to first byte?
- For cacheable responses, substantially, because the response comes from a nearby edge. For uncacheable responses it removes network distance but not server processing time.
- Why is my first measurement always slower?
- It includes a cold DNS lookup and a new connection. Subsequent requests reuse both, which is why repeated measurements differ.
Sources
Related
VeriFixScan crawls a site and applies its checks to every page it reaches, keeping the evidence behind each finding. Scanning one website is free.
Scan a website