Skip to main content

TTFB (Time to First Byte)

Updated: October 29, 2026
By Willya Randika

TTFB (Time to First Byte) is the time from when the browser sends a request until the first byte of the response arrives. It measures how ready the server is, not how fast the whole page renders.

What happens before the first byte

  1. DNS lookup — turns the domain into an IP.
  2. TCP connection and TLS handshake.
  3. The server receives the request and runs PHP/the application.
  4. The database is queried and the cache is checked.
  5. The first byte is sent.

High TTFB can therefore come from DNS, network, a busy server, a slow database query, or a cache miss.

How to measure

  • DevTools → Network → Timing shows Waiting (TTFB).
  • curl -o /dev/null -s -w "%{time_starttransfer}\n" https://example.com gives a terminal TTFB number.
  • WebPageTest separates DNS, connect, TLS, and TTFB.

A common target: below 0.8 s is good, 0.8–1.8 s needs improvement, and above 1.8 s is poor. The number varies by location and network.

What to watch for

  • Cache can hide bad TTFB. Test dynamic and cached pages separately.
  • TTFB is not total load time. A page can have low TTFB but high LCP because of heavy assets.
  • The database is often the cause. Slow queries, missing indexes, or a full connection pool.
  • Server distance matters. A CDN or a closer server location helps.
  • PHP-FPM and OPcache affect execution time; check PHP-FPM and OPcache when dynamic pages are slow.

Test from more than one location before changing the theme or server.

FAQ

What is a good TTFB?

Below 0.8 seconds is good for many cases. Above 1.8 seconds usually feels slow, especially on mobile.

Is TTFB the same as load time?

No. TTFB only covers the first byte. The browser still downloads HTML, CSS, JS, and images afterward.

Does a CDN always lower TTFB?

For visitors far from the origin, usually yes. For visitors close to the origin, the difference can be small.

Disclaimer: Hosting Wiki articles are prepared for educational and reference purposes. Hosting technology keeps evolving, so some technical details may change over time.