The library

The network and the web

Account for every step and every millisecond between typing an address and seeing a page, well enough to say which step a slow or failing load is stuck on, and to reason about a network problem instead of reloading

From an Address to a Page

The classic interview question, answered properly. This course follows one page load through name resolution, connection setup, the request, the round trips nobody counts, and the bytes that come back.

8 lessons, written and corrected before you arrived. Reading them here needs no account. The first reads the whole way through; the others open and then stop, because a page nobody owns cannot tell who is reading it. Starting the course gives you your own copy, where every idea has problems standing under it and you can ask about any sentence.

Start reading

  1. 01Before Anything Can Be Sent, Something Has to Find Out Where to Send It, and Usually That Costs NothingA name lookup is a chain of caches that almost always hits. The interesting case is the one that misses, which can cost a quarter of the load and leaves no trace in the page.
  2. 02Four Round Trips Before the First Useful Byte, and Every One of Them Is the Speed of Light Doing Its Jobopening onlySetting up a connection is an exchange of messages that must happen before any request is sent. Counting them explains why distance beats bandwidth for most pages.
  3. 03The Network Will Lose Some of Your Packets and Tell Nobody, So Everything Above It Is Built on Noticingopening onlyReliability is numbering, acknowledging, and resending what was not acknowledged. The mechanism is simple, and its cost is why a little loss hurts far more than it sounds.
  4. 04Your Connection Is a Hundred Megabits and the First Thing It Sends Is Fourteen Kilobytes, on Purposeopening onlyA sender has no idea what the path can carry, so it starts small and doubles. For anything under a few hundred kilobytes that ramp, not bandwidth, is the whole story.
  5. 05After Four Round Trips of Machinery, What Finally Goes Down the Wire Is a Few Lines of Text You Could Have Typedopening onlyA request and a response are plain lines: a first line, a list of headers, a blank line, a body. Each header is a lever, and knowing which lever does what demystifies most of the stack.
  6. 06The Fastest Request Is the One That Is Never Sent, and Whether It Is Sent Was Decided by a Line of Text Last Weekopening onlyCaching is not lore. Four headers and three questions decide, for any resource, whether a second visit sends nothing, sends a short question, or fetches the whole thing again.
  7. 07You Think You Are Talking to a Server, and You Are Talking to Four Machines That Have Agreed Not to Mention Itopening onlyA request passes through a proxy, a balancer and an edge before anything you wrote runs. Each one helps, each one changes what failure looks like, and each one hides something.
  8. 08The Page Took Two and a Half Seconds, and Four Hundred Milliseconds of That Was Your Codeopening onlyA slow load has four candidate phases and a waterfall tells you which one. Most of the time the answer is not the server, which is why guessing is expensive.