Fetch example.com/index.html and count how many requests one page really takes.
- method
- GET
- path
- /index.html
- host
- example.com
- status
- —
- content-type
- —
- content-length
- —
- etag
- —
- connection
- —
read, change nothing
the resource wanted
required — one IP, many sites
found it, here it is
how to parse the body
where the body ends
used on the next visit
socket stays open for more
HTTP can’t move bytes on its own. What has to exist before the browser can send anything?
A GET request is a few lines of plain text. Step through and watch one request turn into one response — and then watch how one page turns out to need four of them.
One page is not one request. The HTML arrives first, and only then does the browser discover the CSS, the script and the image it needs — each one is its own request over the same connection.
HTTP is stateless: the server remembers nothing between requests. Every request has to carry its own context — that is why Host, cookies and auth headers are repeated every single time.
HTTP does no delivery work of its own. It rides a TCP connection that was already built by a three-way handshake, to an address found by DNS.
Fetch example.com/index.html and count how many requests one page really takes.
- How many HTTP requests did loading one page take?
- What does the server remember about you between requests?
Read it now and keep it in mind — the answer is in what you are about to watch.