How the Web Works
You type a URL. Chaos happens. Here is the slow-motion version.
▶ the lesson · narrated sketch video · tap for sound
the intro
Every website runs on the same loop: your browser asks a server for files, the server sends them, and the browser turns them into a page. HTML is the bones, CSS is the paint, JavaScript is the muscles. Understand this loop and everything else in frontend has a home.
the sample
the whole journey in one exchange
GET /index.html → 200 OK (text/html) browser: parse → paint → interact
fun fact ✦
The first website went live in 1991 — and it is still online at info.cern.ch.
the docs
the deep dive
the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid
Strip away the animations and every website is a conversation. Your browser sends a polite written request, a server somewhere sends files back, and then both sides forget the meeting ever happened. That is the entire trick — everything else in frontend is a variation on it.
the web is messages, not magic
key terms
DNS
The internet's phonebook. It turns the name you typed into an IP address the network can actually route to.
example.com → 93.184.216.34IP address
A number that identifies a machine on the internet. Domains are for humans; IPs are for routers.
142.250.72.14HTTP
The protocol of the web: a request line, some headers, a body. HTTPS is the same thing with TLS encryption wrapped around it.
GET /index.htmlTLS
The handshake that turns a shared connection into a private one. It is why the little padlock shows up in your address bar.
TLS 1.3: one round triphow it works
- 1Type the URL
The browser splits it into scheme, domain, and path, then starts resolving the domain. The clock is already running.
- 2Look up the address
DNS turns the domain into an IP. Your browser and OS cache answers, so repeat visits usually skip this entirely.
- 3Open a secure line
A TCP handshake, then a TLS handshake — a couple of round trips pass before a single byte of HTML is requested.
- 4Ask, receive, render
The browser sends GET, the server answers with HTML, and parsing begins. Every CSS, JS, and image reference inside triggers its own request.
the code, explained
one round trip, in its actual bytes
A modern page quietly fires 50-100 requests. When someone says the site is slow, the HTML is rarely the culprit — open the Network tab and look for the big bars: images, fonts, and third-party scripts eat the budget.
quick answers
Is the web the same thing as the internet?
No. The internet is the plumbing — cables and routers moving packets. The web is one passenger on it, using HTTP. Email and games ride the same pipes.
Why does the second visit feel instant?
Caching. The browser keeps copies of files, and CDNs keep copies in data centers near you, so most of the trip never happens twice.
Do I need to memorize the DNS and TLS steps?
Not the details. But the shape of the answer is the most common interview question in tech, so know the order: DNS, connect, request, render.
quick hits about How the Web Works
short answers · interviews, tips, trivia & hidden gems
What happens when you type a URL?watch ↗
Frontend or backend — where is the line?watch ↗
How does a request actually look?watch ↗
Want to see the web in slow motion?watch ↗
The first website ever built…watch ↗
Want to see how ANY site is built?watch ↗