How the Web Works
Understanding the journey from URL to rendered page helps you optimize each step of the process.
Browser
Server
Every request: DNS lookup (find IP), TCP connection (3-way handshake), TLS negotiation (encryption), then finally the HTTP request. Each step adds latency.
Key point: Connection overhead can exceed content download time
Server sends HTML first. Browser parses it, discovers CSS/JS/images, makes more requests. Each resource blocks or delays rendering differently.
Key point: HTML is small, but it triggers many more requests
Browser builds DOM from HTML, CSSOM from CSS, combines them into render tree, calculates layout, then paints pixels. CSS blocks rendering; JS blocks parsing.
Key point: CSS in
, JS at end of or with deferCSS blocks rendering - nothing paints until CSS loads. Regular JS blocks HTML parsing. defer/async JS loads without blocking. Images load asynchronously.
Key point: Critical CSS inline, defer non-critical JS
