What Happens When You Load a Web Page

Fractional CTO · Founder of Injuria.ai
You type an address, press enter, and a page appears. It feels instant, and most of the time it finishes in well under a second. In that gap your computer runs a sequence of carefully designed steps that involve name lookups, a handshake or two, some cryptography, and a conversation with a server that might be thousands of miles away. Understanding that sequence is one of the most useful things a web developer can do, because almost every performance problem and every strange bug lives somewhere inside it.
Step one: the browser reads the URL
Before anything travels across the network, the browser parses what you typed. A URL has parts, and each one tells the browser something different.
https://www.example.com:443/articles?page=2#top
The scheme (https) is formally a URI scheme, and it tells the browser which protocol to use.[1] The host (www.example.com) names the server. The port (443, implied for HTTPS) says which door to knock on. The path (/articles) names the resource, the query string (?page=2) passes parameters, and the fragment (#top) is handled entirely in the browser and never sent to the server. The browser also checks a few local things first, including its cache and a preloaded list of sites that must always use HTTPS, the HSTS preload list.
Step two: turning a name into an address
Computers do not route traffic using names like example.com. They use IP addresses. The system that translates between the two is DNS, the Domain Name System, and it works like a chain of questions.[2]
Your browser first checks its own cache, then asks your operating system, which asks a recursive resolver, usually run by your internet provider or a service like Cloudflare or Google. If the resolver does not already know the answer, it walks the hierarchy: it asks a root server which machines handle .com, asks one of those which machines are authoritative for example.com, and asks that authoritative server for the actual address. The answer gets cached at every level for a set time, so the next person asking gets it faster. This usually finishes in a few milliseconds thanks to caching, but a cold lookup can add real delay.
Step three: finding the machine, then opening a connection
There is a layer under DNS that most walkthroughs skip, and it is worth a sentence because it explains how packets physically arrive. Knowing the destination IP is not the same as knowing the path to it. On your local network, IPv4 uses ARP, but IPv6 uses the Neighbor Discovery Protocol (NDP) to find hardware addresses, and across the internet, routers use the Border Gateway Protocol to hand your packets from network to network until they reach the server's network. You never see any of this, but it is the machinery that makes "connect to this IP" actually mean something.
With a route available, the browser opens a reliable channel. For most traffic that means TCP, which guarantees bytes arrive in order and nothing is silently lost. TCP opens with a three-way handshake: your computer sends a SYN, the server replies with a SYN-ACK, and your computer answers with an ACK.[3] That is one full round trip before any real data moves, which matters when the server is far away and each round trip costs tens or hundreds of milliseconds.
Step four: securing the connection
If the address uses HTTPS, there is another negotiation on top of TCP: the TLS handshake. Its job is to agree on encryption keys and prove the server is who it claims to be. The browser's opening hello includes the Server Name Indication, the hostname it wants, because modern servers host many domains on one IP and need to know which certificate to present.[4] The server presents that certificate, the two sides derive a shared secret, and from there everything is encrypted. Older TLS needed two round trips. TLS 1.3, the current version, trimmed it to one and can resume a prior session with none at all.[4]
Worth noting: on HTTP/3, this story compresses. QUIC folds the transport and TLS handshakes into one exchange over UDP, so steps three and four happen together in fewer round trips.[6]
Step five: the HTTP request and response
With a secure connection open, the browser finally asks for the page.
GET /articles?page=2 HTTP/1.1
Host: www.example.com
Accept: text/html
That readable form is HTTP/1.1. It is worth being precise, because the version matters: HTTP/2 and HTTP/3 send the same information, but as compressed binary frames with pseudo-headers like :method and :path, not as plain text.[5] The human-readable request line is a teaching convenience, not what goes over a modern wire.
The server does its work, reading a file, running application code, or querying a database, and sends back a response beginning with a status code: 200 for success, 301 or 302 for a redirect, 404 when the resource is missing, 500 when the server erred. Headers follow, then the body, which for a web page is the HTML.
Step six: the handoff to rendering
The HTML almost never arrives alone. As the browser reads it, it finds references to stylesheets, scripts, images, and fonts, each another request, which on HTTP/2 and HTTP/3 travel as parallel streams over the one connection it already opened. HTTP/1.1 did not require six connections; browsers typically limited parallel connections per domain to six to work around head-of-line blocking.
This is where loading becomes rendering, and it is more than "parse and paint." The browser parses HTML into the DOM and CSS into the CSSOM, combines them into a render tree, runs the expensive layout step that computes the exact size and position of every box, paints the pixels, and finally composites the layers onto the screen. Layout in particular is one of the most costly phases and a frequent source of slowness, which is why it has its own article.
Why the whole chain matters
Every step adds time, and the slow parts are usually not the ones people blame. A cold DNS lookup, a far-away server that costs a long round trip, a TLS handshake, a server that sits thinking before it replies, and a dozen render-blocking resources can each cost more than the actual content. When a site feels slow, the answer is almost always somewhere in this sequence.
The reason the journey feels instant is that decades of engineering went into hiding its cost: caches at every layer, connections that stay open and get reused, protocols redesigned to cut round trips, handshakes folded together in QUIC, and servers placed physically closer to users through content delivery networks. The single most useful mindset shift I can offer is this: a web page is not a thing you download, it is a negotiation across a dozen systems, and "make the site faster" almost always means finding the one step in this chain that is quietly costing you more than all the others combined.
Sources (7)
- RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
- RFC 1034: Domain Names, Concepts and Facilities
- RFC 9293: Transmission Control Protocol (TCP)
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
- RFC 9113: HTTP/2
- RFC 9114: HTTP/3
- MDN Web Docs: Populating the page, how browsers work