Skip to content

Monitoring glossary

What is TTFB (time to first byte)?

TTFB is the time from a visitor starting the request to the first byte of the response arriving. It includes the network, the connection and your server’s thinking time.

3 min read9 sectionsUpdated

On this page

Key points

  • Good TTFB is 0.8 seconds or less at the 75th percentile; above 1.8 s is poor.
  • It is the sum of several phases: redirects, DNS, connection, TLS and server processing.
  • A slow TTFB delays everything else, including LCP.
  • Caching HTML at the edge is usually the biggest single win.

What makes up TTFB

PhaseWhat happensTypical cause of slowness
RedirectsFollowing 301/302 responseshttp to https to www chains
DNS lookupResolving the domainSlow DNS provider, no caching
TCP connectionOpening a socketDistance to the server
TLS handshakeNegotiating encryptionOld TLS versions, no session resumption
Server processingYour code building the responseDatabase queries, uncached rendering, cold starts

Thresholds

Google's guidance for field data: good at 0.8 s or less, needs improvement up to 1.8 s, poor above that, measured at the 75th percentile of page loads. TTFB is not a Core Web Vital itself, but it sets a floor for LCP: the largest element cannot paint before the HTML arrives.

Measuring TTFB

bash
curl -o /dev/null -s -w 'dns %{time_namelookup}s\nconnect %{time_connect}s\ntls %{time_appconnect}s\nttfb %{time_starttransfer}s\ntotal %{time_total}s\n' https://example.com/

One curl from your laptop tells you about one network path. For a real picture, measure:

  • From real visitors with real user monitoring, which records TTFB for every page view by country and device.
  • From several regions with uptime checks, which record response time on a schedule.
  • Inside the server with APM, which shows how much of TTFB is your code and which query or call dominates.

How to reduce it

Start with the full guide to reducing TTFB. The short version:

  1. Cache HTML at a CDN for pages that are the same for everyone.
  2. Remove redirect chains: link directly to the final URL.
  3. Fix slow queries found in traces, especially N+1 patterns.
  4. Serve from close to users with a CDN or regional deployment.
  5. Keep connections warm with HTTP/2 or HTTP/3 and TLS session resumption.

Frequently asked questions

Is TTFB a Core Web Vital?

No. The Core Web Vitals are LCP, INP and CLS. TTFB is a diagnostic metric that strongly influences LCP.

Why is my TTFB fast locally but slow for users?

Your machine is close to the server and probably hits a warm cache. Real users add distance, slower networks, and cold caches. Real user data shows what they actually get.

Check it now, free

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.