// Glossary

TTFB (Time to First Byte)

Last updated ·

TTFB (time to first byte) is the time from the start of a request until the first byte of the response reaches the client. In a browser it runs from the navigation's start to the moment the response begins, and it covers redirects, DNS lookup, connection and TLS setup, and the server's time to start answering.

What exactly does TTFB include?

Google's web.dev guide to Time to First Byte defines it as the elapsed time "between startTime and responseStart" and lists the phases it sums:

  1. redirect time;
  2. service worker startup time, if a service worker is present;
  3. DNS lookup;
  4. connection and TLS negotiation;
  5. the request itself, "up until the point at which the first byte of the response has arrived".

The timestamps come from the browser's navigation timing entry, specified by the W3C in Navigation Timing Level 2.

Why does TTFB matter?

Nothing renders before the first byte. The same web.dev guide notes that TTFB precedes First Contentful Paint and Largest Contentful Paint, so a slow first byte delays both. It gives a rough guide: "Good TTFB values are 0.8 seconds or less, and poor values are greater than 1.8 seconds." It also states that TTFB "isn't a Core Web Vitals metric", so it is a diagnostic to improve in service of user-facing metrics rather than a goal on its own.

How does EOXLABS work on TTFB?

EOXLABS splits TTFB into its parts before trying to shrink it, because each part has a different fix:

  • Connection setup shrinks when TLS terminates at a nearby point of presence instead of a distant origin.
  • Server work is exposed with the W3C Server Timing header, which lets a server report its own phases, such as authentication, database and render, to the browser, where scripts can read them through a standard interface.
  • Origin round trips shrink when pages render at the edge and only the data that must come from a central database makes the trip.

Where edge rendering fits a latency budget is the subject of the sub-50 ms edge latency note. SvelteKit, part of EOXLABS's published stack, renders on Cloudflare Workers through its Cloudflare adapter.

What is TTFB often confused with?

  • Server processing time. TTFB includes DNS, connection setup and redirects. A fast server behind a slow redirect chain still has a poor TTFB, and on serverless platforms any cold start falls inside it too.
  • The first byte of the final response. With 103 Early Hints, web.dev explains, "The 103 Early Hints counts as the 'first bytes'". A newer timing entry, finalResponseHeadersStart, marks the start of the final response, and Chrome's handling of responseStart changed in version 115 and was reverted in version 133. Tools can disagree as a result.
  • A fast page. A server can send headers early and then stream the body slowly. A low TTFB is necessary for a fast page, not sufficient.
  • Latency percentiles. TTFB is measured per request, while tail latency describes the slowest requests across a whole distribution.

More web performance terms are in the glossary.

→

Related

+

More glossary

Have a system that can’t go dark?

Start a project →