One page request, end to end
The full path from typing a URL to a rendered page: DNS, TCP, TLS, HTTP, subresources, and where the milliseconds actually go.
The sequence
- URL parsing. The browser splits scheme, host, port and path and decides how to fetch.
- Cache check. A previously cached response with a valid fresh lifetime is reused; conditional revalidation may end in a 304.
- DNS resolution. The hostname becomes an IP address (browser cache, OS cache, recursive resolver).
- Connection. A TCP three-way handshake, or a QUIC handshake for HTTP/3.
- TLS handshake. Certificate verification, key agreement, cipher negotiation — one or two round trips.
- HTTP request. Method, path, headers and any cookies are sent over the established connection.
- Server processing. Routing, authentication, database queries, template rendering.
- Response. Status line, headers, body — possibly compressed and chunked.
- Parsing. HTML is parsed incrementally; the DOM is built as bytes arrive.
- Subresources. CSS (render-blocking), JS (parser-blocking unless deferred), images, fonts.
- Layout and paint. Styles resolve, geometry is computed, pixels are drawn.
- Post-load. Deferred scripts, XHR/fetch, service workers, analytics.
Measuring where the time goes
curl -sS -o /dev/null -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' https://example.com/| Phase | What it includes | Typical fix |
|---|---|---|
time_namelookup | DNS resolution | Reduce TTL churn, use dns-prefetch, fewer hostnames |
time_connect | TCP handshake | preconnect, a CDN edge closer to the user |
time_appconnect | TLS handshake | TLS 1.3, session resumption, OCSP stapling |
time_starttransfer | Server think time | Cache, indexes, fewer round trips to a database |
time_total | Full body transfer | Compression, smaller payloads, HTTP/2 or 3 |
Reading the deltas rather than the totals tells you which team owns the problem. If time_connect minus time_namelookup is large, the user is far from the edge; if time_starttransfer is large, the application is slow.
⚠️
Resist the reflex to blame DNS. In most slow-page reports the delay sits in server think time or in render-blocking subresources, and a DNS change will not move it.
What actually helps
<link rel="preconnect">to the origins you will talk to cuts a handshake off the critical path.- Every extra hostname costs a DNS lookup and often a new connection — consolidate where you can.
- Defer or async non-critical scripts; a blocking script in the head delays first paint for everyone.
- Serve static assets from a long-lived cache with fingerprinted filenames, so repeat visits skip the network entirely.
- Keep TLS certificates complete, current, and served with session resumption enabled.
FAQ
Why is the second visit faster?
DNS is cached, the TLS session can be resumed, and fingerprinted assets come from the disk cache with no request at all. Only the HTML is revalidated, usually costing a 304.
Does HTTP/2 remove the need for bundling?
It removes the connection limit, not the cost of parsing and executing code. Fewer, larger bundles still win; the old trick of splitting CSS across many files is what HTTP/2 obsoletes.
Related
HTTP and DNS in practice Layered models and TCP/IP
Last refreshed 2026-09-18.