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

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