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

browserDNS lookupweb server
before any HTML moves, the name has to become a number

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.34

IP address

A number that identifies a machine on the internet. Domains are for humans; IPs are for routers.

142.250.72.14

HTTP

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.html

TLS

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 trip

how it works

  1. 1
    Type the URL

    The browser splits it into scheme, domain, and path, then starts resolving the domain. The clock is already running.

  2. 2
    Look up the address

    DNS turns the domain into an IP. Your browser and OS cache answers, so repeat visits usually skip this entirely.

  3. 3
    Open a secure line

    A TCP handshake, then a TLS handshake — a couple of round trips pass before a single byte of HTML is requested.

  4. 4
    Ask, 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

1GET /learn/frontend HTTP/1.1
method plus path: what you want and where it lives
2Host: learn.erickowicaksono.com
which site you mean — one IP can host thousands
3
4HTTP/1.1 200 OK
the server's verdict: 200 means here you go
5Content-Type: text/html; charset=utf-8
one HTML fileCSS fileJS fileimages
the HTML is domino one — it names everything else the page needs
🪤 gotcha

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

🎤 interview

What happens when you type a URL?watch ↗

🎤 interview

Frontend or backend — where is the line?watch ↗

📚 tutorial

How does a request actually look?watch ↗

🔧 useful

Want to see the web in slow motion?watch ↗

🧠 trivia

The first website ever built…watch ↗

💎 deep

Want to see how ANY site is built?watch ↗