What happens When You Enter a URL into Your Browser?
The complete workflow from typing a URL to getting the webpage you want
👋 Welcome
A warm welcome to the 4 new subscribers joining us this week.
Let me know what you think of this post in a comment, if it’s no trouble. If you prefer Twitter, drop me a DM.
Now, let’s get started with this issue.
What happens When You Enter a URL into Your Browser?
Let’s look at the components of the URL that you typically type into the search bar of your browser:
The scheme is used to tell the browser to send the connection to the server using secure http or “https”.
The domain is the name of the website that you’re trying to access. Here’s it’s Twitter.
The path refers to the path on the server that you’re trying to access. Here, you want to view the Twitter timeline, hence “home”.
If you are reading this article and haven’t subscribed (for FREE) yet, what’s stopping you?
Next, the browser needs to understand what this URL stands for, meaning it needs to know the IP address of the domain (the website) you’re trying to access.
This is done with the DNS lookup function. DNS stands for Domain Name System which basically acts like a phonebook for the internet. Every website runs on a server, and each server has an IP address, so every website needs to be “looked up” via an IP address.
This is looked at in the DNS cache, which can be either located in the OS cache, browser cache, or the cache from the Internet service provider.
The DNS cache is just a memory of recent DNS lookups that your computer performed and can quickly refer to when it's trying to figure out how to load a website.
If this process does not provide the IP address, the browser needs to go the DNS servers to perform a DNS lookup until it does find the IP address.
Now that the browser has the IP address of the domain (website), it first establishes a TCP connection with the webserver and then sends a secure HTTP request to the server.
In this case for instance, it’s a GET request to the /home
server path on the host domain “twitter.com”.
Next, the server sends the response and a successful response status code is 200. The HTML of the webpage is received by the browser.
Finally, the browser renders the website content into your empty page.
Next time…
So there you go with a quick read on the lifecycle of typing out a URL into the browser. I hope you enjoyed it.
In the coming week, we’ll delve into looking at how to build a Go webserver with concurrency enabled, so stay tuned for that!
Thank you for reading! Find me on Twitter. :)
If you found value in this issue, share it with your friends too maybe? 😃