Skip to content

Computing foundations · Part 2 of 10

What happens when you type a URL and press Enter

A tour from the address bar to pixels on screen: DNS, TCP, TLS, HTTP, server work and rendering. Where time goes at each step.

· 2 min read

networkingweb

A classic question, and a useful map. Each step is a place where delay or failure can hide.

1. The browser parses the URL

It splits https://example.com/products?id=7 into scheme, host, path and query. It checks its caches and may already know the answer or hold a connection.

2. DNS lookup

The host name is resolved to an IP address, using the operating system cache, then a recursive resolver, as described in the article about DNS. A slow or failing resolver delays everything after it.

3. Connection and encryption

The browser opens a TCP connection to the server, a handshake that costs one round trip. For HTTPS it then performs a TLS handshake to agree on keys and verify the certificate. With HTTP/3 these two steps are combined over QUIC. Distance matters: every round trip across a continent costs tens to hundreds of milliseconds.

4. The HTTP request and the server's work

The browser sends a request such as GET /products?id=7 with headers for cookies, language and caching. Often a load balancer or CDN receives it first and may answer from its cache. If not, the request reaches the application, which may check authentication, query a database, call other services and render a response.

Code
GET /products?id=7 HTTP/1.1
Host: example.com
Accept: text/html

5. The response and rendering

The server replies with a status code, headers and a body, typically HTML. The browser then:

  1. Parses the HTML into the document tree and discovers CSS, JavaScript and images, which cause further requests.
  2. Builds the style information and computes the layout.
  3. Paints the pixels and runs JavaScript, which may change the page again.

CSS and synchronous scripts can block rendering, which is why performance work focuses on sending less, sending it earlier and caching it.

Where to look when it is slow. The browser's network panel shows a timeline per request: DNS, connection, waiting for the first byte and download. A long wait for the first byte points at the server, a long download at payload size.

Takeaway

A page load is many small steps: name, connection, security, request, response and render. Knowing the steps tells you where to measure.

A knowledge article, drafted with AI assistance and checked with automated tests. It is general background, not a description of my own experience or of any client's work.

Comments

Leave a comment

No account or email needed. Comments appear after review. A one-way hash of your IP address is kept for 30 days to fight spam, then erased.