How the Web Works
The web is a system for sharing documents over a network. When you type a URL, your browser sends an HTTP request to a server, which responds with the resources — HTML, CSS, JavaScript — needed to render the page.
The Request-Response Cycle
Every interaction on the web follows the same pattern:
- Your browser resolves the domain name (e.g.,
example.com) to an IP address via DNS. - The browser opens a TCP connection to that IP on port 443 (HTTPS).
- A TLS handshake encrypts the connection.
- The browser sends an HTTP GET request for the page.
- The server responds with an HTML document.
- The browser downloads linked CSS, JavaScript, and images.
- The browser renders the page.
Key Abstractions
- HTTP is a stateless request-response protocol — each request is independent.
- URLs encode the scheme, host, path, and sometimes query parameters.
- Statelessness means the server does not remember previous requests unless you use cookies or tokens.
- Caching lets browsers and CDNs store responses to avoid redundant requests.
The web's simplicity — a client asks, a server responds — is what makes it scale globally. Every framework, library, and infrastructure decision builds on this foundation.