Module 1 · FundamentalsLesson 2 of 886 minBeginner
What happens when you open a website
Before a single byte of the page arrives, your browser finds the server, connects, and agrees on encryption.
Watch "First visit" and count the round trips. Then switch to "Repeat visit" and see how much setup the browser skips.
Typing shop.com and pressing Enter feels like one action. Behind it are four separate conversations.
1. DNS: find the address
Computers connect to numbers (IP addresses like 93.184.216.34), not names. Your browser asks a DNS resolver to translate the name. This often takes a few milliseconds because the answer is cached nearby.
2. TCP: open a connection
The browser and server shake hands: "Can we talk?" "Yes." "Great." This TCP handshake makes sure both sides are ready and agree on how to number the data they send.
3. TLS: make it private
For https:// sites, they then agree on secret keys. The server proves who it is with a certificate, so you know you are really talking to shop.com and not an impostor.
4. HTTP: ask for the page
Only now does the browser send GET /. The server builds the page and sends it back with a status code like 200 OK.
Why this matters for design
Each step is a round trip: a message there and an answer back. If the server is 100 ms away, four round trips cost 400 ms before the page even starts arriving.
That is why big sites:
- put servers close to users (CDNs, which you will meet later),
- keep connections open and reuse them,
- cache DNS answers.
The server's own work is often the smallest part of the wait.