Skip to content

Time to First Byte (TTFB)

How long the browser waits for the server to start responding.

Good
800 ms or less
Needs improvement
800 ms to 1.8 s
Poor
over 1.8 s

What it measures

TTFB runs from the start of the visit to the first byte of the page arriving. It covers redirects, the DNS lookup, connection and TLS setup, and the time your server takes to build the response. Every other loading metric starts after it.

How TTFB is measured

Real visitors (field data)
The Chrome UX Report includes TTFB from real visits, so it reflects how far visitors are from your server and how fast their networks are.
Lighthouse (lab data)
Lighthouse reports the server response time for the main document. Our own probe also times the first byte from our server, with every redirect hop listed.

An example

A visitor types example.com. The server redirects to https://example.com, which redirects again to https://www.example.com, and then builds the page from the database. On a phone each redirect adds a full round trip, so much of the 800 ms budget can be gone before the server starts on the page. One redirect straight to the final URL, plus a cached page, removes most of that wait.

Common causes of a poor TTFB

  • Pages built from scratch on every request.
  • Slow database queries or API calls while rendering.
  • No CDN, so visitors far from the server wait longer.
  • Redirect chains, like http to https to www.

How to improve it

  1. Cache whole pages. Serve HTML from a full-page or edge cache instead of rendering it each time.
  2. Use a CDN. Put a CDN in front of the site, so responses come from a location near the visitor.
  3. Fix slow backend code. Profile the request and fix the slowest queries and API calls.
  4. Remove redirects. Link straight to the final URL, and send other versions there in one hop.

TTFB questions

What is a good TTFB?

800 milliseconds or less. Between 0.8 and 1.8 seconds needs improvement, and over 1.8 seconds is poor.

Is TTFB a Core Web Vital?

No, but it comes before everything else. A slow TTFB makes a good LCP very hard to reach.

Why is my TTFB slow only sometimes?

Usually because of caching. A visitor who hits a cached page gets a fast response, and one who misses the cache waits for the full render. Cold starts on serverless hosting have the same effect.