What happens when you visit a website
Typing a web address and pressing enter kicks off a whole chain of events that happens in less than a second. Once you know the steps, a website stops feeling like magic.
Let's follow what happens when you type a web address, like allcloudacademy.com, into a browser and press enter.
Step 1: Finding the address
A domain name is the easy to remember address of a website, like allcloudacademy.com. But computers don't actually use names to find each other. They use numbers, called addresses.
So the first thing that happens is your device asks a kind of phone book of the internet, "what number belongs to this name?" That phone book sends back the right number, and your device now knows exactly where to send its request.
Step 2: Asking the server
A server is a computer whose job is to store information and send it to other computers when they ask for it. The website's server owns the actual files that make up the page you want to see: the words, the pictures, the layout.
Your device sends a request to that server, basically saying "please send me this page." The request travels across the internet as packets, the same way you learned about in the last lesson.
Step 3: The server replies
The server gathers up everything needed for the page and sends it back to your device, again broken into packets that travel back across the internet and get reassembled.
Step 4: The browser builds the page
A browser is the program you use to visit websites, like Chrome, Safari or Edge. Once your browser has all the pieces, it puts them together and draws the page on your screen: the text in the right place, the pictures loaded, the colors and layout all arranged the way the website designed it.
All four of these steps usually happen in well under a second, which is why a website feels instant even though your device just had an entire conversation with a computer that might be on the other side of the world.
Open a browser and look closely at the address bar at the top. Visit two or three different websites and notice what stays the same about how the address is written, and what changes. See if you can spot the domain name in each one.
- Domain name
- The easy to remember address of a website, like allcloudacademy.com.
- Server
- A computer whose job is to store information and send it to other computers when they ask for it.
- Browser
- The program you use to visit websites, like Chrome, Safari or Edge.
What is a server's job?
To store a website's files and send them to your device when it asks for the page.
What does a browser do with the pieces it receives?
It puts them together and draws the finished page on your screen.
About how long does the whole process usually take?
Usually well under a second, even though your device is talking to a server that might be far away.
- Visiting a website means your device finds the right server, asks for the page, and gets it sent back.
- The browser is the program that puts everything together and shows you the finished page.
- All of this usually happens in under a second.