You open your browser, type in https://www.example.com
, hit Enter⦠and a website appears. Easy, right?
But under the hood, your computer is doing a ton of work in just milliseconds. Letās walk through what actually happens, step-by-step ā without too much jargon, but enough for both devs and curious minds.
1. Your Browser Breaks Down the URL
When you hit Enter, your browser looks at the parts of the URL:
-
https
ā the protocol (says āuse a secure connectionā) -
www.example.com
ā the domain (who youāre trying to reach) -
/blog/article
ā the path (what you want from them) -
?search=javascript
ā optional query info
So far, no connection has been made. This is just the browser prepping for the real work.
2. š Finding the Websiteās Address (DNS Lookup)
Your browser canāt just call āwww.example.comā ā it needs the websiteās IP address, like 93.184.216.34
.
Hereās how it finds it:
- Checks your computerās memory (maybe youāve been here before)
- Asks your Wi-Fi router
- If no one knows, it asks your ISP
- If needed, it travels all the way up to the ārootā DNS servers to figure out where
example.com
lives
Eventually, it gets the answer: āHereās the IP. Go talk to this server.ā
Think of it like looking up someoneās phone number before calling them.
3. š Connecting to the Server (TCP + TLS Handshake)
Now that your browser knows where to go, it says: āHi server, can we talk?ā
This happens in two parts:
- TCP handshake: Like knocking on the door and confirming someoneās home.
- TLS handshake: Because itās HTTPS, your browser and the server agree on encryption so that no one can snoop on the conversation.
This all happens in milliseconds.
4. Sending the Request (GET)
Now your browser says:
āHey
www.example.com
, Iād like the homepage please.ā
This is a GET request ā it's like asking a librarian for a specific book.
5. The Server Prepares the Response
On the other end, the server:
- Sees your request
- Runs some code (maybe using Node.js, Python, PHP, etc.)
- Might ask a database for info
- Then bundles everything into a response
It sends back something like:
HTTP/1.1 200 OK
Content-Type: text/html
<!DOCTYPE html>
<html>
<head><title>Welcome</title></head>
<body>Hello, visitor!</body>
</html>
6. š§ The Browser Starts Building the Page
Once the browser receives that HTML:
- It reads the HTML and builds the DOM (a structure of the page)
- It fetches any linked CSS (for styles) and JavaScript (for behavior)
- It puts everything together visually ā fonts, colors, images, buttons
- It runs any JavaScript (maybe interactive stuff like menus or sliders)
Now you're looking at a fully working website.
7. Behind the Scenes: Optimizations
Good websites do more than just respond. Developers can:
- Use CDNs to deliver content faster around the world
- Preload assets the browser will need soon
- Compress files to speed up delivery
- Lazy-load images so they load only when needed
All this makes things feel instant ā even though thereās a ton happening.
TL;DR (Too Long; Didnāt Read)
When you type a URL and hit Enter:
- Your browser breaks down the URL
- It finds the IP address using DNS
- It connects securely to the server
- Sends a GET request
- The server builds a response
- Your browser builds and shows the page
All in a blink. ā”
Understanding this process is super helpful ā whether you're a web developer or just someone curious about how the internet works. Itās a modern magic trick, made of real tech.
šāāļø Enjoyed this post? Follow me on Twitter for more dev tips and threads!
Top comments (0)