You type an address and press enter. Roughly this happens:
- DNS lookup. The domain name is translated to an IP address, because computers route by number.
- A connection opens to that address, usually secured with TLS, which is the S in HTTPS.
- Your browser sends a request. A method, a path, and some headers.
- The server sends a response. A status code, headers, and usually a body.
- The browser parses the HTML, and requests everything it references: stylesheets, scripts, images, fonts.
- 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.