TTFB

Caching

Overview

TTFB (Time To First Byte) is the time from when the client sends a request to when the first byte of the server's response arrives.

It sums DNS lookup, TCP/TLS handshake, request transmission, server processing, and the start of the response — representing the front portion of perceived load speed.

Details

Don't equate TTFB with total latency. TTFB measures only 'up to the first byte,' so a large response body can still download slowly even with a good TTFB. Conversely, TTFB includes not just pure network round trips (RTT) but also server-side processing (DB queries, rendering), so a high TTFB might be a network issue or a backend bottleneck.

Remedies span multiple layers: CDNs and edge caches answer from close to the user, cutting both RTT and server work at once; connection reuse (Keep-Alive), HTTP/2, and QUIC reduce handshake cost; and server-side caching plus query tuning shrink processing time. TTFB is a good starting point for web-performance diagnosis, but for perceived experience it should be read alongside rendering-completion metrics like LCP.

Related types