What happens when you open a website?
One browser. One visit. Follow the address to a working page, and experiment along the way.
An address is a set of instructions.
The scheme tells the browser how to communicate, the hostname identifies the destination, and the path identifies a resource.
https://garden.example/plants scheme hostname path
Scheme: HTTPS. Use HTTP over an encrypted connection.
The URL identifies a resource—not the page itself.
Is the path a file? What about ? and #?
The server chooses what a path means; it need not point to a file on disk. A query such as ?sort=name is sent to the server. A fragment such as #care stays in the browser, not the HTTP request.
The browser is the client; the server is software that responds. That server role might be fulfilled by one computer or a large fleet.
Turn a name into an address.
DNS resolves garden.example to an IP address. The browser can then contact the web server directly—not through DNS.
garden.example → 192.0.2.10 Source: recursive resolver’s answer
DNS finds an address. It does not deliver the webpage.
Where does the DNS answer come from?
- The browser or OS checks for a usable cached answer.
- A recursive resolver checks its cache.
- On a cache miss, it follows referrals: root → top-level domain → authoritative nameserver.
- The answer can be cached for its time to live (TTL).
Cached referrals can shorten the process. A name may resolve to several addresses or point to another name. A record change does not instantly replace every cached copy.
.example is reserved for documentation. This is an illustration of DNS, not a live lookup.
Connect, then encrypt.
This visit opens a TCP connection, then uses TLS to check the server’s identity and establish encryption keys.
TCP: SYN → SYN + ACK → ACK TLS: certificate checks + encryption keys HTTP/2 connection ready
TCP delivers ordered bytes. TLS protects them.
What does the certificate prove?
The certificate must cover the hostname, pass validity and trust-chain checks, and the handshake must verify possession of its private key. This authenticates an endpoint—not an honest business or truthful content.
What can a network observer see?
HTTPS protects HTTP paths, headers, and bodies from a passive network observer. Destination IP addresses, timing, and traffic sizes can remain visible. DNS or connection setup may expose the hostname. HTTPS is not anonymity.
Without HTTPS, HTTP content is readable on the network and an active attacker may alter it. The server receiving an HTTPS request can still read its contents.
Does every visit need TCP and TLS setup?
Browsers can reuse connections and resume secure sessions. This model uses a new HTTP/2 connection over TCP + TLS. The resource-cache toggle later changes only how page assets load, not this connection.
HTTP/1.1 and HTTP/2 normally use TCP. HTTP/3 uses QUIC over UDP, with TLS security integrated into QUIC—not the TCP handshake shown here.
Ask for a resource. Receive HTML.
The browser requests /plants. The server returns a status, headers, and an HTML response body—not a screenshot.
GET /plants Host: garden.example Accept: text/html [No session cookie] Response: 200 OK Content-Type: text/html Cache-Control: private, no-store <h1>Your small garden</h1> <p>Welcome, guest.</p> <link rel="stylesheet" href="/style.css">
Guest visit: no session cookie. The server returns the guest version of the page.
Illustrative response wait: 160 ms.
404 and 500 are server answers. DNS and TLS failures stop this visit before HTTP.
How does the server recognize a signed-in user?
HTTP has no built-in signed-in identity. This toggle assumes an earlier successful sign-in: the server issued a session ID, and the browser stored its cookie. It compares two versions of this request; it does not submit a login form.
Earlier sign-in: POST /login → 200 OK Set-Cookie: demo_session=demo-7; Path=/; Secure; HttpOnly; SameSite=Lax This visit: GET /plants Cookie: demo_session=demo-7 Server checks session → HTML with a personal greeting
The greeting comes from the server’s HTML, not from JavaScript or cached assets. A cookie carries an ID—not a password or automatic permission. The server must accept the session and check permissions separately. If its session expires, the cookie alone cannot restore it.
This public page is available to guests too, so both visits can return 200 OK. A protected page could reject a guest instead. Cookie sessions are one design; applications can use other credentials, such as bearer tokens.
What protects a session cookie?
Keep real session IDs secret. Secure restricts normal sending to secure transport; HttpOnly blocks page JavaScript from reading the cookie, but the browser still sends it. SameSite limits cross-site sending and helps mitigate some CSRF attacks, not all attacks.
Domain and path rules also affect sending. Responses use Set-Cookie to store a cookie; requests use Cookie to send matching name/value pairs without their attributes. A real sign-in system also needs safe credential handling, session rotation, expiry, and permission checks. No real cookie is set here.
What do the method, headers, and status mean?
GET requests a resource; headers carry metadata. 200 means success, 404 means this resource was not found, and 500 means a server error. A browser can display an error response’s HTML too.
A POST request can carry a body, such as form data. A redirect, such as 301 or 302 with a Location header, leads to another request. HTTP also carries JSON, images, and other data; Content-Type describes the body.
These are readable message sketches, not literal HTTP/2 bytes. HTTP/2 encodes messages in binary frames.
One page. More requests.
The HTML references CSS, an image, and JavaScript. The browser discovers and fetches them, often concurrently.
/style.css 200 OK /plant.svg 200 OK /app.js 200 OK
Even a 404 or 500 page can load resources. A missing image need not break the rest of it.
What makes a repeat visit faster—or out of date?
The browser can reuse fresh cached resources instead of downloading them again. A stale response can sometimes be validated; 304 Not Modified lets it reuse the cached body.
The toggle changes only the public CSS, image, and script. A fresh cache hit means no network request for that resource; the page looks the same. A missing-image experiment assumes no usable cached image, so that request still returns 404. DNS caching is separate, in step 2. The HTML is always fetched here, with Cache-Control: private, no-store, so personalized content is not reused between visitors. Cache behavior depends on headers and browser state. Cache-Control: no-cache means validate before reuse, not “never store.”
Resources become a working page.
The browser parses HTML, applies CSS, lays out elements, and paints pixels. JavaScript handles the garden’s watering button. Try it in the browser.
HTML → document tree CSS → styles and layout → paint JavaScript → click handler
HTML supplies structure, CSS presentation, and JavaScript custom behavior.
Does rendering really happen last?
No. The browser can discover resources while parsing HTML, fetch several concurrently, and paint content before all resources arrive. Some stylesheets and scripts can delay rendering or parsing. The steps separate overlapping activities for clarity.
Not every interaction requires JavaScript: links, native forms, and expandable details can work without it. The custom watering action in this example needs a script.
Step 1 of 6 · Read the URL.
Where did this visit spend its time?
Invented times, not measurements. Bars share a 0–1,800 ms scale. Actual requests and rendering overlap.