Перейти к содержимому
Skip to content
← All articles

The Complete HTTP Request Lifecycle: From URL to Rendered Page

When you type a URL and press Enter, a complex chain of events unfolds in milliseconds. Understanding this lifecycle is fundamental for web developers — it's the foundation for diagnosing performance issues, security problems, and network errors.

Step 1: URL Parsing

The browser parses the URL into components:

https://www.example.com:443/path/page?query=value#section
│       │                │   │         │           │
scheme  host             port path     query       fragment

The browser checks: Is this a valid URL or a search query? If no scheme, prepend https://. If no port, use defaults (443 for SSL/TLS проверку, 80 for HTTP).

Step 2: DNS Resolution

The browser needs to convert the hostname to an IP address:

  1. Browser cache: Check recently resolved domains (Chrome: chrome://net-internals/#dns)
  2. OS cache: Check the operating system's DNS cache
  3. Hosts file: Check /etc/hosts (or C:\Windows\System32\drivers\etc\hosts)
  4. Router cache: Your local router may cache DNS
  5. ISP resolver: Query the configured DNS resolver (ISP, Google 8.8.8.8, Cloudflare 1.1.1.1)
  6. Recursive resolution: Root → TLD → Authoritative nameserver

Typical time: 1-100ms (cached) or 20-200ms (cold cache).

Step 3: TCP Connection

The browser establishes a TCP connection via the three-way handshake:

  1. SYN: Client sends a synchronization packet to the server
  2. SYN-ACK: Server acknowledges and sends its own sync
  3. ACK: Client acknowledges — connection established

This takes one full round trip (RTT). For a server 50ms away, that's 50ms just for the handshake.

Step 4: TLS Handshake

For HTTPS, an additional handshake establishes encryption:

  1. Client Hello: Supported TLS versions, cipher suites, random number
  2. Server Hello: Chosen cipher suite, server certificate, random number
  3. Certificate verification: Client verifies the certificate chain against trusted CAs
  4. Key exchange: Both sides derive a shared session key
  5. Finished: Both sides confirm encryption is active

TLS 1.2 requires 2 round trips. TLS 1.3 reduces this to 1 round trip (and supports 0-RTT for returning connections).

Step 5: HTTP Request

The browser sends the HTTP request:

GET /path/page?query=value HTTP/2
Host: www.example.com
User-Agent: Mozilla/5.0 ...
Accept: text/html,application/xhtml+xml
Accept-Encoding: gzip, br
Accept-Language: en-US,en;q=0.9
Cookie: session=abc123
Connection: keep-alive

Step 6: Server Processing

  1. Web server: Nginx/Apache receives the request, applies configuration rules
  2. Reverse proxy: May forward to an application server
  3. Application: Routes the request, runs business logic, queries databases
  4. Database: Executes queries, returns results
  5. Response generation: Application builds HTML/JSON response
  6. Compression: Server compresses the response (gzip/Brotli)

Step 7: HTTP Response

HTTP/2 200 OK
Content-Type: text/html; charset=utf-8
Content-Encoding: br
Cache-Control: max-age=3600
Set-Cookie: session=abc123; Secure; HttpOnly
Content-Length: 45231

Step 8: Browser Rendering

  1. HTML parsing: Build the DOM (Document Object Model) tree
  2. CSS parsing: Build the CSSOM (CSS Object Model) tree
  3. JavaScript execution: Parse and execute scripts (may block rendering)
  4. Render tree: Combine DOM + CSSOM into a render tree
  5. Layout: Calculate exact position and size of each element
  6. Paint: Fill in pixels — colors, borders, shadows, text
  7. Composite: Combine layers into the final image on screen

Performance Implications

Each step offers optimization opportunities:

Conclusion

Every HTTP request traverses DNS, TCP, TLS, server processing, and browser rendering — each adding latency. Understanding this lifecycle is the key to diagnosing "why is my site slow?" and knowing exactly where to optimize.

Check your website right now

Check now →
More articles: HTTP
HTTP
HTTP Status Codes: Complete Reference with Examples
10.03.2025 · 24 views
HTTP
Server-Sent Events vs WebSockets: Choosing Real-Time Communication
16.03.2026 · 21 views
HTTP
Analyzing Server Response Headers: What They Reveal About a Website
11.03.2026 · 12 views
HTTP
HTTP Methods Explained: GET, POST, PUT, DELETE and Beyond
16.03.2026 · 16 views