EarniculumGet early accessJoin
← All free samplesFREE SAMPLE LESSON

How the Web Works · What happens when you open a page

The journey of a request

Type an address, press enter. Six things happen, and knowing them explains most web problems.

beginnerEnglish16 minArticle

You type an address and press enter. Roughly this happens:

  1. DNS lookup. The domain name is translated to an IP address, because computers route by number.
  2. A connection opens to that address, usually secured with TLS, which is the S in HTTPS.
  3. Your browser sends a request. A method, a path, and some headers.
  4. The server sends a response. A status code, headers, and usually a body.
  5. The browser parses the HTML, and requests everything it references: stylesheets, scripts, images, fonts.
  6. It renders, running any JavaScript as it goes.

Almost every question about why a site is slow, broken, or behaving oddly is a question about one of those six.

Why this matters even if you never build a server

  • Slow page? Usually step 5, too many things to fetch, or step 6, too much JavaScript.
  • Works locally, fails deployed? Usually a step 3 or 4 difference: a different address, a missing header, a blocked origin.
  • Something loads but looks wrong? Step 5 ordering, or a request that failed silently.

A request, seen plainly

```

GET /courses/javascript-foundations HTTP/1.1

Host: earniculum.com

Accept: text/html

```

A method (GET), a path, and headers describing what you want and who you are.

And a response

```

HTTP/1.1 200 OK

Content-Type: text/html; charset=utf-8

Cache-Control: public, max-age=3600

```

A status, then headers, then the body. Everything on the web is this exchange repeated, thousands of times a day.

END OF FREE SAMPLE

That lesson is yours to use.

Reading this sample did not enroll you, save progress, or issue a certificate. No reward was earned. Continue with the full course for the remaining lessons and assessments.

Join the waitlist Review the full course