How a browser turns a URL into a page
From the address bar to pixels: navigation, parsing, the render pipeline, JavaScript, and what makes pages fast or slow.
On the roadmap:Beginner · step 2: How the web works
Lesson 11 of 18 · 10 min read · quiz · exercise
From address bar to HTML
When you press Enter on https://example.com/page:
- The browser decides if it is a URL or a search, and checks its caches (HTTP cache, service worker).
- DNS turns the name into an IP address; a TCP connection and TLS handshake follow (with HTTP/3, QUIC does both at once). See the networking lessons.
- It sends an HTTP request and receives the HTML response, streaming in as it arrives.
A multi-process program
Modern browsers run as several processes for speed and safety:
- a browser process (address bar, tabs, navigation),
- a renderer process per site or tab (parsing, JavaScript, layout, painting),
- a network process, and a GPU process for drawing.
A crashing or malicious page is isolated in its own renderer and cannot read other sites' data.
The rendering pipeline
Figure SDA-RWS-11-1 · Browser rendering pipeline · © forcsguy.com
- Parse HTML into the DOM (a tree of elements). Parsing is incremental: the browser starts working before the whole file arrives.
- Parse CSS into the CSSOM. Rendering waits for CSS, because showing unstyled content then restyling would flash. CSS is render-blocking.
- Combine into the render tree (only visible elements, with computed styles).
- Layout works out the size and position of every box.
- Paint draws the boxes into layers.
- Composite: the GPU assembles layers into the final image. Animating a layer's
transformoropacityonly needs this last step.
JavaScript on the main thread
- JavaScript runs on the renderer's main thread, one task at a time in an event loop, alongside parsing, layout and input handling. A long script blocks everything, and the page feels frozen.
- A normal
<script>is parser-blocking: parsing stops until it downloads and runs. Usedefer(run after parsing, in order) orasync(run as soon as available) for scripts not needed to build the first view. - Changing the DOM or styles can trigger reflow (layout again) and repaint. Reading layout values in a loop right after writing styles forces repeated layout (layout thrashing): batch reads and writes.
What makes pages fast
| Goal | Techniques |
|---|---|
| Less to download | Compression (brotli, gzip), image optimisation and modern formats, remove unused JavaScript |
| Fewer round trips | CDN, HTTP/2 and 3, preconnect, caching with long lifetimes and versioned names |
| Less blocking | Inline critical CSS, defer scripts, avoid huge CSS and fonts blocking text |
| Smooth interaction | Break up long tasks, move heavy work to web workers, animate with transform and opacity |
| Load only what is visible | Lazy-load images and routes |
Browsers also cache, preload likely navigations, and can run offline logic with service workers.
Measuring
Use the Core Web Vitals: LCP (when the main content appears), INP (responsiveness to input) and CLS (unexpected layout shifts). Check both lab tests and real-user data, because real devices and networks are slower and more varied than a developer laptop.
Real-world reading
Related reading
- Chrome Developers BlogGoogle engineers · GoogleBlogs
- Android Developers BlogGoogle engineers · GoogleBlogs
- The Road to QUICCloudflareBlogs
- Julia Evans' BlogJulia Evans · jvns.caBlogs
Show 6 moreShow fewer
- Cloudflare BlogCloudflare engineers · CloudflareBlogs
- RFC 9000: QUICIETFDocumentation
- Cloudflare EngineeringCloudflare engineers · CloudflareBlogs
- Web VitalsGoogle web.dev · GoogleDocumentation
- Curalate Engineering BlogCuralate engineers · CuralateBlogs
- Zapier Engineering BlogZapier engineers · ZapierBlogs
Check your understanding
Question 1 of 3
0 correct so far
Why can a plain script tag in the head slow the first paint of a page?
Go deeper
- How browsers work by Google Chrome developers (web.dev): search the site for 'critical rendering path' and 'Inside look at modern web browser'
Practise it: The first lookup is DNS
Everything below is already set up for this lesson: change the design, run the traffic, and see whether you meet the goal.
- 1The task
- 2Build and test
Before anything else a browser looks up your name. At 20 seconds your only DNS service fails.
Goal: Under 1% errors even though a DNS copy fails.
Select the DNS part and look at its redundant copies.
Try it yourself
A page takes 4 seconds to show anything on a slow phone. List five things you would check or change, in order of likely impact.
Click what a strong design here would need:
More in Real systems
© 2026 forcsguy.com. Original lesson text and diagrams. Books and sites linked above belong to their authors.