Module 22 · The Web Is Not the Internet

What happens between typing an address and seeing the page?

Lesson 22.2 · What Happens When You Press Enter

Sarah · Rob · Jenny · Mark

One blink. A whole whiteboard.

Grandma Ruth types her recipe site’s address and presses Enter, and the page is there before she’s moved her hand back.

Sarah asks the crew to list everything that happened in that blink. Between Modules 20, 21 and this one, they can.

It takes a whole whiteboard.

The short answer

DNS finds the address, the laptop connects and sets up encryption, the browser asks for the page, the server sends HTML, the browser fetches the pictures and draws it. Grandma Ruth’s apple pie page did all that in under half a second, which she found more impressive than anything else they’d told her.

Try it yourself

Put the steps in order, from pressing Enter to seeing the recipe.

Tap the pieces in order. Tap one again to take it back.

—

What you just did has a name

HTTP, HTML and browsers

A web browser is an app that fetches and shows web pages.

It asks a web server for a page using HTTP, the web’s protocol: basically “please send me this page.”

The server sends back HTML, a text format that describes the page’s content and structure, plus links to images and styles.

The browser then fetches those and draws the finished page, following the code’s instructions.

A few more things

View the source

Most desktop browsers let you right-click a page and view its source: the HTML the server sent. It’s just text with tags.

The address is a path

In pettigrewlab.com/learn, the name finds the server and the part after the slash is the path to the page on it, like the file paths in Module 18.

Modern pages are apps

Many pages also send JavaScript, code the browser runs to make the page interactive. That’s why a busy web page can eat a lot of memory.

Go deeper

The longer version, if you want it.

Status codes

Every time a server answers, it includes a number. 200 means “here you go.” 404 means “there’s no page at that address.” 500 means “something broke on our end.”

The famous “404 Not Found” is the server politely telling your browser the path in the address doesn’t lead to anything. It’s Module 18’s “no such file,” over the internet.

Quick check

What does a web server send back first when you ask for a page?

Let’s take it slower

Ordering at a restaurant: you find the restaurant (DNS), sit down (connect), order (HTTP request), get the menu description of your meal (HTML), then the dishes arrive one by one (images and styles), and you put it together on your plate (the browser draws the page). Except the whole meal arrives in less than a second.

More examples

1

A slow page

A page that shows text first and images later is the browser drawing the HTML before all the extras have arrived.

2

A broken link

Click an old link and get a 404: the server is there, but nothing lives at that path anymore.

Back to the question

So what happens when you press Enter?

Show the answer

DNS finds the address, the laptop connects and sets up encryption, the browser asks for the page, the server sends HTML, the browser fetches the pictures and draws it. Grandma Ruth’s apple pie page did all that in under half a second, which she found more impressive than anything else they’d told her.

One last question

Build what a browser does.

Tap the pieces in order. Tap one again to take it back.

…
Talk Card

Talk Card · 22.2

Every web page you open was a conversation: your browser asked, a server answered with HTML, and the browser drew it.

How Computers Work · pettigrewlab.com/learn

Next lesson