Have you ever wondered what happens between typing https://example.com into your browser and seeing the website appear on your screen?
It feels almost instant.
You enter a URL, press Enter, wait a moment, and the webpage appears. You can click buttons, open menus, watch videos, and interact with different elements.
But behind that simple action, several technologies work together.
DNS finds the server. Network protocols establish communication. HTTPS protects the connection. The server processes your request and sends a response. Finally, the browser turns HTML, CSS, and JavaScript into the webpage you see.
Understanding this process is one of the most useful things a web developer can learn.
Whether you're building websites, developing APIs, working with frontend frameworks, or learning backend development, knowing what happens behind the scenes helps you understand how the web actually works.
Let's follow a single request from the moment you press Enter.
1. The Browser First Understands the URL
Imagine you enter this address:
https://www.example.com/products?id=25 Before contacting a server, the browser interprets the URL.
A URL contains several parts:
| Component | Example | Purpose |
|---|---|---|
| Protocol | https | Defines how communication is secured |
| Hostname | www.example.com | Identifies the destination |
| Path | /products | Identifies the requested resource |
| Query string | ?id=25 | Provides additional parameters |
The browser uses this information to determine where the request should go and how it should communicate.
For example, HTTPS normally uses port 443, while HTTP normally uses port 80.
If the URL contains a fragment such as #reviews, that fragment is generally handled by the browser and isn't sent as part of the HTTP request.
But there's still one important problem.
The browser knows the website's domain name, but it needs an IP address to communicate with the destination.
That's where DNS comes in.
2. DNS Finds the Website's IP Address
DNS stands for Domain Name System.
Think of it as the internet's address directory.
Humans remember names like:
google.comgithub.comexample.com
Computers use IP addresses to route network traffic.
When your browser needs to reach a domain, it uses DNS resolution to discover the appropriate IP address.
A simplified DNS lookup works like this:
- The browser or operating system checks available DNS caches.
- If the answer isn't cached, a DNS resolver is contacted.
- The resolver may query other DNS servers to find the required record.
- The resolver returns the result, such as an A or AAAA record.
- The browser can use the returned address to establish a connection.
For example, an IPv4 DNS record might look like this:
example.com → 93.184.216.34 This is an illustrative example of DNS mapping, not a guarantee that the address will remain the same.
You can try looking up a domain yourself:
nslookup example.com Or use:
dig example.com These commands help developers understand how domain names resolve to IP addresses.
Why does DNS matter?
Without DNS, people would need to remember IP addresses instead of convenient domain names.
It also plays an important role in website infrastructure, including load balancing, content delivery networks, and domain management.
3. The Browser Establishes a Connection
Now the browser knows where it needs to send the request.
The next step is establishing communication.
For HTTPS websites, this typically involves a secure connection using TLS.
There are two common transport approaches worth understanding.
TCP
Traditional HTTPS connections commonly use TCP.
TCP establishes a connection between the client and server through a process known as the three-way handshake.
The process involves:
- SYN: The client requests a connection.
- SYN-ACK: The server acknowledges the request.
- ACK: The client confirms the connection.
After this process, both sides can exchange data over the established TCP connection.
QUIC
Modern HTTP/3 uses QUIC, which runs over UDP rather than TCP.
QUIC integrates transport security using TLS 1.3 and provides connection establishment and stream handling designed for modern internet communication.
This distinction matters because HTTP/3 doesn't use the traditional TCP three-way handshake.
What About TLS?
For a secure HTTPS connection, TLS helps protect communication between the browser and the server.
During a TLS handshake, the client and server negotiate security parameters, authenticate the server using its certificate, and establish shared encryption keys.
This helps protect sensitive information from being read or modified while traveling across the network.
For example, when you submit login credentials through HTTPS, the connection encrypts the communication between your browser and the server.
You can learn more through MDN's TLS documentation.
4. The Browser Sends an HTTP Request
Once the necessary connection is ready, the browser can send an HTTP request.
HTTP stands for Hypertext Transfer Protocol.
It defines how clients and servers exchange information.
A simplified HTTP request might look like this:
GET /products?id=25 HTTP/1.1 Host: www.example.com Accept: text/html User-Agent: ExampleBrowser This request communicates several things:
-
GETis the HTTP method. -
/products?id=25identifies the requested resource. -
Hostidentifies the requested hostname. -
Acceptindicates the content types the client can accept. -
User-Agentidentifies the requesting software.
There are several HTTP methods developers commonly use:
| Method | Common Purpose |
|---|---|
| GET | Retrieve information |
| POST | Submit data |
| PUT | Replace a resource |
| PATCH | Partially update a resource |
| DELETE | Delete a resource |
For example, when a user opens a product page, the browser might send a GET request.
When a user submits a registration form, the application might send a POST request containing the submitted information.
You can inspect HTTP requests yourself using Chrome DevTools.
Open a website, press F12, select the Network tab, and reload the page.
You'll see requests, response codes, headers, resource sizes, and timing information.
This is one of the most useful debugging techniques for web developers.
5. The Request Reaches a Server
After leaving the browser, the request travels through the network infrastructure toward its destination.
Depending on the website's architecture, it may pass through:
- Routers and network gateways.
- A content delivery network (CDN).
- A reverse proxy.
- A load balancer.
- A web server.
- An application server.
Not every website uses all these components.
For example, a simple static website might be served directly from a CDN without running application code for every request.
A dynamic application may require backend processing.
Imagine a user visiting an ecommerce product page.
The backend might need to:
- Identify the requested product.
- Retrieve product information from a database.
- Check inventory.
- Load relevant images or metadata.
- Generate an appropriate response.
A simplified Node.js example might look like this:
import express from "express"; const app = express(); app.get("/products/:id", async (req, res) => { const productId = req.params.id; // Example data for demonstration const product = { id: productId, name: "Wireless Headphones", price: 79 }; res.json(product); }); app.listen(3000, () => { console.log("Server running on port 3000"); }); When a client requests /products/25, the server processes the route and returns a JSON response.
Real applications would usually retrieve product information from a database and include validation, error handling, and appropriate security checks.
6. The Server Sends an HTTP Response
After processing the request, the server sends an HTTP response.
A simplified response might look like this:
HTTP/1.1 200 OK Content-Type: application/json { "id": "25", "name": "Wireless Headphones", "price": 79 } The response contains a status code, headers, and sometimes a response body.
Here are some HTTP status codes developers should recognize:
| Status | Meaning |
|---|---|
| 200 | OK |
| 201 | Created |
| 301 | Moved Permanently |
| 302 | Found |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
| 503 | Service Unavailable |
These codes help the browser and other clients understand what happened during a request.
For example:
- A 200 response generally means the request succeeded.
- A 404 response means the requested resource wasn't found.
- A 500 response indicates an internal server error.
An important detail: a successful HTTP response doesn't necessarily mean the application operation was successful in a business sense. Developers still need to inspect the response body and application-level errors.
7. The Browser Starts Building the Webpage
This is where things become particularly interesting for frontend developers.
The browser receives HTML and begins processing it.
It doesn't simply display the HTML as a finished document.
Instead, it parses the markup and builds an internal representation called the DOM (Document Object Model).
Consider this HTML:
<!DOCTYPE html> <html> <head> <title>My Website</title> </head> <body> <h1>Hello, Developers!</h1> <p>Welcome to my website.</p> </body> </html> The browser parses this document and creates a tree-like structure.
Conceptually, the DOM looks something like this:
Document └── html ├── head │ └── title └── body ├── h1 └── p The DOM represents the structure and content of the page.
JavaScript can interact with it through browser APIs.
For example:
const heading = document.querySelector("h1"); heading.textContent = "Welcome to Web Development!"; This changes the heading's text without requiring a completely new HTML document.
8. CSS Builds the Visual Appearance
HTML provides structure, but CSS controls how the page looks.
When the browser processes CSS, it builds another internal representation called the CSSOM (CSS Object Model).
For example:
body { font-family: Arial, sans-serif; background: #f5f5f5; } h1 { color: #2563eb; font-size: 32px; } The browser uses CSS rules to determine how HTML elements should appear.
It then combines the DOM and CSSOM information to construct a render tree.
The render tree contains the visible elements and their computed styles.
This is an important part of the browser's critical rendering path.
9. Layout, Paint, and Compositing Turn Everything Into Pixels
Once the browser has the information needed to render the page, it performs several operations.
Layout
The browser calculates the size and position of visible elements.
For example:
- Where should the navigation bar appear?
- How wide should the main content be?
- Where should an image be positioned?
- How much space should exist between sections?
Paint
The browser determines how individual elements should be visually drawn.
This includes text, backgrounds, borders, shadows, and other visual details.
Compositing
The browser combines different visual layers into the final image displayed on the screen.
Some content may be composited using the GPU, depending on the browser and rendering requirements.
The overall process can be simplified as:
HTML ↓ DOM CSS ↓ CSSOM DOM + CSSOM ↓ Render Tree ↓ Layout ↓ Paint ↓ Compositing ↓ Pixels on Screen This is how the browser transforms code into the visual webpage you interact with.
10. The Browser Continues Loading Other Resources
Receiving the initial HTML doesn't mean the entire website has finished loading.
The HTML may reference additional resources:
- Stylesheets.
- JavaScript files.
- Images.
- Fonts.
- Videos.
- API endpoints.
The browser discovers these resources and requests them when necessary.
For example:
<link rel="stylesheet" href="/styles.css"> <script src="/app.js" defer></script> <img src="/images/hero.webp" alt="Website homepage preview" width="1200" height="600" > The browser needs to download and process the relevant resources to complete the page experience.
This is also why developers need to understand resource loading priorities.
A stylesheet can block rendering while it is being processed. A traditional synchronous script can block HTML parsing. Using defer, appropriate loading priorities, and optimized resource delivery can help improve the initial experience.
However, not every resource must finish loading before the browser can show useful content.
The browser can progressively process and render a page as resources become available.
11. What Happens When You Click Something?
The process doesn't stop after the initial page appears.
When you click a button, JavaScript may respond to the interaction.
For example:
const button = document.querySelector("#load-products"); button.addEventListener("click", async () => { const response = await fetch("/api/products"); if (!response.ok) { throw new Error("Unable to load products"); } const products = await response.json(); console.log(products); }); Here is what happens:
- The user clicks the button.
- JavaScript handles the click event.
- The browser sends a request using
fetch(). - The server processes the request.
- The server returns a response.
- JavaScript processes the returned JSON.
The application can then update the interface using the received data.
This is how many modern websites provide interactive experiences without reloading the entire document.
The Entire Journey in One Diagram
Let's put everything together.
User Enters a URL | v Browser Parses URL | v DNS Resolves Domain | v Connection Established (TCP or QUIC) | v TLS Security (HTTPS) | v HTTP Request Sent | v Server / CDN Processes Request | v HTTP Response Returned | v Browser Receives HTML | v DOM + CSSOM Created | v Render Tree Constructed | v Layout -> Paint -> Composite | v Webpage Appears | v User Interacts With Website This is a simplified overview. Real browsers and network architectures can perform several of these operations concurrently, reuse existing connections, serve cached resources, and follow different paths depending on the protocol and website infrastructure.
Why Understanding This Process Matters for Developers
You might wonder why a frontend developer needs to understand DNS or TLS.
The answer is simple: websites don't operate in isolated layers.
A frontend problem might actually originate from the backend. A slow page might be caused by DNS resolution, a delayed server response, a large JavaScript bundle, or a render-blocking stylesheet.
Understanding the complete request lifecycle helps developers investigate problems more effectively.
For example:
| Problem | Where to Investigate |
|---|---|
| Domain doesn't resolve | DNS configuration |
| Secure connection fails | TLS certificate and configuration |
| Server returns 404 | URL, routing, and server configuration |
| Server returns 500 | Backend application and logs |
| API response is slow | Network, server, and database |
| Page appears without styling | CSS loading and processing |
| Button doesn't respond | JavaScript and event handling |
Instead of randomly changing code, you can investigate the layer where the problem actually occurs.
Understanding these concepts is also valuable when planning real-world digital projects. From website architecture and user experience to frontend development and technical implementation, every decision contributes to the final product.
At The Creative Unit, we explore creative digital solutions, website design, and development that help businesses build a stronger online presence.
Tools Every Web Developer Should Know
If you want to understand what happens when a browser loads a website, these tools are worth exploring.
1. Chrome DevTools
The Network tab lets you inspect requests, responses, headers, status codes, and loading times.
Chrome DevTools Network Documentation
2. DNS Lookup Tools
Commands such as nslookup and dig help investigate domain resolution.
3. cURL
You can make HTTP requests directly from your terminal.
curl -I https://example.com This displays response headers and helps you inspect server responses.
4. Wireshark
Wireshark allows developers and network engineers to inspect network traffic and investigate communication problems.
Visit Wireshark
5. MDN Web Docs
MDN provides detailed explanations of HTTP, DNS, browser rendering, JavaScript, and other web technologies.
Explore MDN Web Docs
Final Thoughts
The next time you type a URL and press Enter, remember that a lot more is happening than simply opening a webpage.
Your browser interprets the URL, resolves the domain, establishes communication, sends an HTTP request, receives a response, processes HTML and CSS, executes JavaScript, and renders the result on your screen.
Each stage plays an important role in making the modern web work.
Understanding these fundamentals doesn't just help you become a better frontend developer. It also gives you a stronger foundation for backend development, API integration, debugging, security, and performance optimization.
The web may feel instant to users, but behind every click is a fascinating chain of engineering decisions.
Let's Discuss
Before reading this article, did you know that your browser builds the DOM and CSSOM before constructing the render tree?
Which part of this process do you find most interesting: DNS, HTTP communication, server-side processing, or browser rendering?
Share your thoughts in the comments!
Further Reading
- MDN: How the Web Works
- MDN: How Browsers Work
- MDN: Critical Rendering Path
- web.dev: Understanding the Critical Path
Tags: webdev beginners programming javascript
![Embedded Software Engineering — Ch.10: OTA Firmware Update [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm6nak2soahu0o1ww35hy.png)
![Embedded Software Engineering — Ch.11: Embedded Security [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8lj1zci0ucpfvn91aqd5.png)


![Embedded Software Engineering — Ch.12: Embedded Case Studies [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fth5r2cczjsot6ae55lq5.png)