Wirebook

Wirebook › Lesson 1 of 18

What happens when you open a web page?

About 6 minutes · hands-on · nothing you type leaves your browser unless a button says so

You type an address, press Enter, and about a tenth of a second later a page appears. In that blink, your request crosses cities, gets translated, locked in a box, unlocked, answered and painted on screen. Let's slow it right down.

Step through a real page load

Press Next step (or the arrow keys) to follow one request for https://learn.oddlathe.com/.

Yourbrowser DNS resolver Cloudflareedge Tunnel(outbound) Small serverin London

    Time it yourself

    This button sends five tiny requests to this site's server and measures how long each round trip takes. Nothing is stored; it just asks the server "what time is it?"

    The journey, in plain words

    1. Find the address. Computers don't understand names like learn.oddlathe.com; they need a number (an IP address). Your device asks a DNS resolver, a kind of phone book. The answer is usually cached for minutes or hours, so later visits skip this step.
    2. Shake hands. Your browser opens a connection and does a TLS handshake: the server proves who it is with a certificate, and both sides agree on fresh secret keys. That's the padlock. From here on, everything is encrypted.
    3. Ask politely. The browser sends an HTTP request: "GET / please, I speak English, I accept HTML". It's just a few lines of text.
    4. Through the tunnel. This site's server never opens its doors to the internet. Instead it keeps an outgoing connection to Cloudflare, called a tunnel, and requests are passed back down it. That means no open ports for strangers to knock on.
    5. Answer. A tiny Python program reads a file and replies "200 OK" with the page. It took the server well under a millisecond.
    6. Paint. Your browser reads the HTML, spots the stylesheet and script it needs, fetches those too, works out where every box goes (layout) and colours in the pixels (paint).

    Most of the waiting is distance, not thinking. Light in fibre travels about 200 km every millisecond, so a round trip from Edinburgh to London and back costs about 5 ms before any computer does anything at all. That's why big sites copy their pages to servers all over the world.

    Words from this lesson

    Earn your stamp

    Get all 3 right to collect the The journey of a click stamp. Wrong answers are fine: just try again.

    1. What does DNS do?

    2. Where does most of the waiting usually come from?

    3. What does the padlock (TLS) handshake give you?

    Try another lesson

    1. 2Anatomy of a web address5 min · interactive
    2. 3Can a website get tired?7 min · interactive
    3. 4Secret codes: encryption and hashing7 min · interactive