What Happens When You Type a URL

The single most important mental model: ~15 steps from keystroke to pixels on screen

The Complete Flow

This is the single most important mental model in web development. When you type a URL and press Enter, approximately 15 things happen in sequence. Understanding this flow connects every topic in this course.

Phase 1: RESOLUTION
  1. URL Parsing        Browser breaks URL into scheme, host, path, query, fragment
  2. DNS Lookup         Browser asks DNS: "What IP is example.com?" → 93.184.216.34

Phase 2: CONNECTION
  3. TCP Handshake      SYN → SYN-ACK → ACK (three-way handshake)
  4. TLS Handshake      If HTTPS: negotiate encryption (certificate, cipher suite)

Phase 3: REQUEST
  5. HTTP Request       Browser sends: GET /path HTTP/1.1, Host: example.com, headers...
  6. Server Routing     Web server (Apache/Nginx) routes requests to correct handler

Phase 4: PROCESSING
  7. App Processing     Application code runs (PHP, Node.js, Python, etc.)
  8. Database Query     App may query a database, read files, call other APIs

Phase 5: RESPONSE
  9. HTTP Response      Server sends: HTTP/1.1 200 OK, headers, body (HTML/JSON/etc.)
 10. TCP Delivery       Response travels back through TCP/IP stack

Phase 6: RENDERING (browser-side)
 11. HTML Parsing       Browser reads HTML top-to-bottom, builds DOM tree
 12. CSS Processing     Browser parses CSS, builds CSSOM, and computes styles
 13. JavaScript Exec    Browser runs JS (may modify DOM, fetch more data)
 14. Layout & Paint     Browser calculates element positions and paints pixels
 15. Display            Pixels appear on the screen.

The Six Phases

These steps can be grouped into natural phases:

Phase Steps Where It Happens Learn More
Resolution 1–2 Client + DNS URLs
Connection 3–4 Client ↔ Server Tutorial 2 (Network Stack)
Request 5–6 Client → Server HTTP
Processing 7–8 Server Tutorial 17 (Execution Models)
Response 9–10 Server → Client HTTP
Rendering 11–15 Client (Browser) Tutorial 19 (Architecture Generations)