What happens when you type a URL in the web browser and press Enter?

 You may have been curious about how you enter a URL in your browser and you get the webpage delivered to you within a short period of time, within that short period of time, a lot of data has been transferred and received by your browser. Follow me up as I put you through how your browser interacts with the web server.

Before I proceed, let me explain what a browser is, a browser is a software application that is used to access the web, interpret code, and display webpage content. Examples are Chrome, Safari, Edge, Firefox, etc. 

When you enter a URL in your browser there is a lot of web interaction that happens, but fortunately, it happens within a blink of an eye, even your brain might not even think about it because it happens extremely quick.

So, let's summarize what happened within a few seconds, firstly your computer sends a request to the DNS (domain name system) which serves as an address book for domain names and returns the IP address of the URL server. 

After knowing the IP address, your computer establishes a connection with the server via the IP address, this connection is known as TCP (Transmission Control Protocol) so, your computer now has the ability to establish this connection via the IP. This process is called handshake.

If your computer uses a firewall, the firewall cross-checks if the particular request is allowed before permitting it, likewise the server too, it checks if the request is authorized before you can able to connect to the server. After the connection is established, the browser now sends a request for the webpage using an encryption protocol like SSL (Secure Sockets Layer) or TLS (Transport Layer Security) in order to encrypt the data shared between the computer and the server.

A load balancer is required if the website receives high traffic, the load balancer act as a reverse proxy to distribute network or traffic across a number of servers, so the requests from your web browser will hit the load balancer and forward it to a particular server depending on the load balancer algorithm. After the server receives the request it responds by sending a response back to the load balancer which will forward the response (response includes HTML, CSS, and JavaScript) back to the browser.

The response returned will tell the browser how to render the content of the web page. The HTML files will tell the browser how to display the content while the CSS will tell the browser how to style it, and the Javascript will tell the browser how to interact with the content.

If the website has some dynamics content, The web server will send a request to the Application server which might send a request to the database server to fetch so data and send it back to the server, The web server will now have to include the data in the response that will be sent back to the browser, and finally, your browser will show the web page.

Previous Post Next Post