Web and protocol foundations
From DNS to response: a request’s journey
Identify the stage causing latency.
Understand the concept
A browser may resolve the hostname before opening a connection. HTTP/1.1 and common HTTP/2 deployments use TCP; HTTPS negotiates authenticated encryption through TLS. HTTP/3 uses QUIC. Reused DNS results or connections can skip stages for subsequent requests.
TTFB is not merely backend execution time: network transit, proxies, queues and server preparation can contribute. Download time depends on size and bandwidth. DevTools Timing separates stages, but combine it with server traces before assigning a root cause.
Connection reuse can reduce latency. Caches and preconnect change observations. Distinguish cold and warm loads rather than assuming one fast measurement represents every device.
Avoid optimising the wrong layer on slow pages.
Blaming all TTFB on the database.
One topic. Three levels of depth.
DNS → connect → TLS → request → TTFB → downloadTypical stages of a network request.
This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.
Try it yourself first.
What can lower DNS or TLS timing on a second request indicate?
Show the solution and explanation
Cold load ≠ warm loadCaching and connection reuse may be involved; it does not prove faster backend execution.