TTFB (time to first byte) is the time from a navigation request to the first byte of the response. It is not a Core Web Vital, but every Core Web Vital that depends on loading starts after it. A slow server response adds time to LCP, but a fast one does not fix LCP on its own, because the browser still has to find, fetch and render the largest element.

This article covers what TTFB includes, how it feeds LCP, which server-side changes lower it, and why one timing from one machine tells you little.

What TTFB measures

MDN defines TTFB as the time between the browser requesting a page and receiving the first byte of the response. For HTTPS, it includes DNS lookup plus the TCP and TLS handshakes [5].

So TTFB is not just "how fast my application code runs." It is the sum of several steps:

  1. Redirects, if the requested URL is not the final URL.
  2. DNS lookup.
  3. TCP connection and TLS negotiation.
  4. The request travelling to the server or edge.
  5. Server processing: routing, database queries, template rendering.
  6. The first byte travelling back.

A slow database query and a distant server can produce the same TTFB number. They need different fixes.

TTFB vs LCP: how they relate

web.dev describes TTFB as a foundational metric that comes before First Contentful Paint and LCP, so a higher TTFB adds time to both [3]. LCP also counts more than the server's work. web.dev says it includes unload time from the previous page, connection setup time, redirect time, and other TTFB delays [4].

Think of LCP as a sequence in which TTFB is the first block:

StageWho controls itFixed by a faster server?
Redirects, DNS, connection setupHosting, DNS, CDN, URL hygienePartly
Server response (TTFB)Backend, cache, CDNYes
Discovering the LCP resource in the HTMLMarkup, JavaScript, lazy-loading choicesNo
Downloading the LCP resourceImage size, format, priorityNo
RenderingCSS, JavaScript, main-thread workNo

If your TTFB is already low and LCP is still poor, the delay is in the lower rows. Speeding up the server further will not move it. The Core Web Vitals guide covers thresholds and the fixes for those later stages.

What Google says about it

Two points from Google and Chrome documentation are worth keeping straight.

First, TTFB is not one of the Core Web Vitals. Google Search Central says there is no single page experience signal. Its core ranking systems look at a variety of signals, and Core Web Vitals are used by those systems [1]. Google also says good Core Web Vitals scores do not mean top rankings, because page experience involves more than those metrics alone [1].

In practice, treat TTFB as a diagnostic input. Lowering it helps because it lowers the metrics that depend on it. It is not a ranking lever you can tune in isolation.

Second, the Chrome UX Report (CrUX) treats TTFB as an experimental metric, measured on full page loads only, so its sample can be smaller than for metrics like LCP [2]. CrUX TTFB also includes cold page loads, cached page loads and loads from an established connection, so it should not be compared directly with every other loading metric [2].

What lowers TTFB

Cache the document

The biggest lever for most sites is not serving the HTML from the origin at all. A CDN that caches the document at the edge removes the origin processing step and shortens the network path.

Cloudflare's documentation shows how this affects measurement. Its origin TTFB field reflects TTFB from the edge's perspective, includes both network round-trip time and origin processing time, and is 0 when the request is served from CDN cache without reaching the origin [6]. A zero there means "the origin was not involved," not "the page was instant for the visitor."

Use stale-while-revalidate for pages that change rarely

web.dev says a stale-while-revalidate strategy can make a document's TTFB nearly instant when the document changes infrequently [3]. A typical header looks like this:

Cache-Control: public, max-age=0, s-maxage=300, stale-while-revalidate=60

The shared cache serves a stored copy and refreshes it in the background. Adjust the numbers to how often your content changes. Do not apply this to pages with per-user content, such as carts or account pages, without careful cache keys.

Remove redirect hops

Every redirect is a full extra request before the final document. Link internally to the final URL, and collapse chains such as http:// to https:// to www into a single hop. See HTTP status codes for SEO and AI crawlers for which redirect to use.

Reduce origin work

If the cache misses, the origin still has to be quick. Common targets are slow database queries, uncached template fragments, and synchronous calls to third-party APIs during page render. Profile the backend rather than guessing.

What a single server-side timing can't tell you

A reading from curl, a hosting dashboard or a CDN log is useful, but it answers a narrow question.

curl -o /dev/null -s -w "dns %{time_namelookup}  connect %{time_connect}  tls %{time_appconnect}  ttfb %{time_starttransfer}\n" https://example.com/page

This shows the breakdown for one request from one location. It cannot tell you:

  • Redirects. web.dev says lab tools often measure the final URL and can miss redirect delay, which is why it recommends field data as the primary source for observing TTFB [3]. Run the command against the URL users actually arrive on, such as the one in a link or an ad.
  • Cache state. The same URL can return a cache hit or a miss. One sample shows only one of them. CrUX itself mixes cold loads, cached loads and loads on warm connections [2].
  • Edge versus origin. An origin timing from a CDN log reflects the edge's view, not the visitor's [6].
  • Visitor conditions. Device, network and distance from the server differ per user. A test from a data center is not a mobile connection.
  • What happens after the HTML arrives. TTFB ends at the first byte. It says nothing about when the browser discovers the LCP image, how large it is, or what blocks rendering [4].

A good TTFB tells you the server stage is not the problem. It does not tell you the page is fast.

A practical way to diagnose

  1. Check field data first (CrUX through PageSpeed Insights or Search Console) for TTFB and LCP on the affected page group.
  2. If TTFB is high, test the real entry URL with curl several times and note redirects, DNS, connection and server time separately.
  3. Compare a cache hit with a cache miss. Check response headers for your CDN's cache status.
  4. If TTFB is fine but LCP is not, move to resource discovery, image weight and render-blocking work.
  5. Re-measure in field data after the change. Field data takes time to reflect fixes, so judge it over a period, not one day.

What to do next

  • Pull TTFB and LCP field data for your top templates and compare the two.
  • Test the real entry URL, not just the canonical one, and count the redirects.
  • Put the HTML document behind a cache where the content is not personalized, and consider stale-while-revalidate for rarely changing pages.
  • Add server response checks to your routine with the technical SEO checklist or a one-hour audit.