Skip to main content
Performance

Time to First Byte (TTFB)

Published:
Updated:

For navigation, TTFB runs from navigation start to response start, for example responseStart − startTime in Navigation Timing. It can include redirects, DNS, connection setup, network latency and server work. DevTools Waiting (TTFB) starts later and does not cover the same interval.

TTFB is not a Core Web Vital. It delays document availability and can increase LCP, but a fast response does not guarantee fast rendering. Attribute each additional 100 ms to a measured phase instead of automatically blaming HTML generation.

What makes up TTFB

  • Redirects (e.g. HTTP → HTTPS, non-www → www).
  • DNS resolution and TCP + TLS connection setup.
  • Server response generation time (database, rendering, APIs).
  • Network distance between the user and the server.

How to reduce TTFB

The most common improvements are caching full HTML responses (CDN, reverse proxy), generating pages ahead of time (SSG/ISR instead of on-demand rendering), optimizing database queries, HTTP/2 or HTTP/3, and serving content from locations close to users. Apply HTML caching only after defining personalization and invalidation rules.

Example

Simplified scenario without redirects or queueing: 12 + 48 + 620 = 680 ms until the first byte; content download comes later. Waiting includes network latency and server work. The cache header below is only for public, unpersonalized responses; do not copy it to accounts, payments or responses containing user data.

Typical time breakdown (scenario)
Example
DNS lookup:        12 ms
TCP + TLS:           48 ms
Waiting (TTFB):     620 ms  ← network + server work
Content download:    35 ms
─────────────────────────
Total to 1st byte:  680 ms
HTML cache on CDN: response header
HTTP
Cache-Control: public, max-age=60, s-maxage=3600, stale-while-revalidate=86400

Sources & further reading

Check your site performance

Insight measures Core Web Vitals and ranks bottlenecks by impact.