HTTP Request Lifecycle
The HTTP request lifecycle is the complete sequence of network operations that occur from the moment a client initiates a request to a URL — including DNS resolution, transport connection, optional TLS negotiation, the HTTP exchange itself, and connection teardown or reuse.
The HTTP request lifecycle is the complete sequence of network operations that occur from the moment a client initiates a request to a URL — including DNS resolution, transport connection, optional TLS negotiation, the HTTP exchange itself, and connection teardown or reuse.
Most developers think of HTTP as a simple request/response pair, but understanding the full lifecycle reveals hidden latency sources and optimization opportunities.
Phase 1 — DNS Resolution: Before any connection is opened, the hostname must be resolved to an IP address. This involves checking browser cache, OS cache, recursive resolver, and potentially the full DNS hierarchy. See How DNS Works for details. This phase typically adds 0–100ms on a cold lookup.
Phase 2 — TCP Handshake: A TCP connection is established via the TCP Three-Way Handshake (SYN → SYN-ACK → ACK). This adds one round-trip time (RTT) of latency — typically 10–100ms depending on geography.
Phase 3 — TLS Negotiation: For HTTPS, TLS adds 1–2 more RTTs for certificate exchange, cipher negotiation, and key derivation. TLS 1.3 reduces this to 1 RTT. See TLS Handshake for the full exchange.
Phase 4 — HTTP Request/Response: The client sends the HTTP request (method, headers, optional body). The server processes it and returns a status code, headers, and body. For APIs, this is the REST call you think of; see REST API Request Lifecycle.
Phase 5 — Connection Reuse: HTTP/1.1 keep-alive, HTTP/2 multiplexing, and HTTP/3's QUIC streams all allow reusing the underlying connection for subsequent requests, amortizing the setup cost. HTTP/2 Multiplexing shows how multiple requests share a single connection.
Understanding each phase helps developers target the right optimization: CDN for DNS/TLS proximity, connection pooling to avoid repeated handshakes, and HTTP/2 push to eliminate sequential request waterfalls.