FrontendLesson 2 of 48 min

Names, addresses, and connections

Why a domain name is a lookup, why HTTPS matters, and why the first visit is always slower.

Machines on the internet find each other by number, not by name. A domain name is a human convenience layered on top, and turning one into the other is a real network round trip that costs real milliseconds.

What the first visit pays for
  1. DNS lookup
    Name to address. Cached afterwards.
  2. TCP handshake
    Agreeing to talk at all.
  3. TLS handshake
    Agreeing to talk privately: the S in HTTPS.
  4. First byte
    Only now does the server start answering.

Every one of those steps is a trip across physical distance. Light is fast but not instant: a round trip from London to Virginia is roughly 80 milliseconds no matter how good your code is. Four round trips before a single byte of content is why "where is the server?" is a performance question, not a trivia question.

HTTPS is not optional and not just about passwords. Without it, anything between you and the server (an ISP, an airport wifi router, a government) can read and modify the page. Modern browsers now assume it, and some features simply refuse to run without it.

What to remember

  • A domain name is a lookup, and lookups are cached in places you do not control.
  • The first connection pays for DNS, TCP, and TLS before any content moves.
  • Physical distance sets a floor on speed that no amount of code removes.

Terms in this lesson

Field notes

Loaded from a deliberately slow source. The lesson above was already readable while this was still travelling. That is streaming, and it is the same trick a chat interface uses.

The bug was three caches deep

A team spent two days on a "deploy that did not work". The deploy was fine. A CDN rule was caching the HTML document itself for an hour, so every visitor kept getting the previous build. The fix was one header; finding it needed knowing the copies existed.

Reported by a solo founder, 2024

Nobody had opened the empty state

A product launched with a dashboard that looked superb with demo data and completely blank on day one. Every new signup saw an empty white rectangle and assumed the app was broken. Signup-to-activation doubled after a two-hour fix.

Common enough to be a cliché

resolved in 901ms · region iad1

Hide field notes toggles a search param the loader reads. With it off, the slow promise is never created, so nothing streams.