Time to First Byte (TTFB) is the duration from when a client sends an HTTP request to when it receives the first byte of the response. TTFB includes DNS lookup, TCP connection, TLS handshake, server processing, and network transit. Google's Core Web Vitals threshold is TTFB under 800ms for a 'good' score.
TTFB measures the full end-to-end latency to start receiving a response. It breaks down as: DNS resolution time + TCP connection time + TLS handshake time + server processing time + time for first byte to travel back. CDNs reduce TTFB by bringing the server physically closer to the user. Database query optimization reduces server processing time. TLS 1.3 and HTTP/3 reduce handshake time. TTFB is a leading indicator of page performance – every millisecond of TTFB directly delays all subsequent page loading.
Latency
Latency is the time delay between a request being sent and the first byte of a response being received. Measured in milliseconds. Network latency is dominated by the speed of light over physical distance (1ms per 100km), plus queuing and processing delays.
Round-Trip Time (RTT)
Round-Trip Time (RTT) is the time for a packet to travel from source to destination and a response to return. RTT determines how many round trips fit in a given time window. TCP handshakes, TLS negotiations, and DNS lookups each consume RTTs before data can flow.