How Does A Web Browser Load a Web Page?

Pawan Mittal
Sep 7, 2018 · 4 min read

Internet is a network of computers distributed across the world. This network allow us access to vast amount of information. The speed of access is so fast that right now I am able to follow the progress of Irma over Florida in real time. Technologies that enable this super-network have been developed over past few decades and are still evolving. But the underlying architecture or paradigm behind internet has not changed as the tools that make it possible continue to develop. That architecture is called client-server architecture. On this post I will introduce three key players that are part of the client-server model of the internet. Let’s start with web page. A webpage is a document that encapsulates and displays the information like the contents of this post. But, since Mr Web Page is right here with us and you are looking at him right now, how about let’s have him talk about who he is and what he does.

Mr Web Page

Hello, I am Mr Web Page. Everything you are see on your web browser is a me. I hold the contents of the website you requested when you click on a link or enter my address into the address bar. I have no idea how you got to me, but now that you are here I am going to tell you how your web browser loads me so you can enjoy everything I have to offer.

Your journey to me begins when you enter a web address e.g, www.medium.com into the address bar of your browser, or click on a link with the address embedded in it — like this one.

And thats’s all you need to do. Rest is taken care of you by the Mr Browser. But how? Well how about let’s have Mr Browser explain that to us? So, without further ado please give a big hand for Mr Browser as he joins me to explain how he does his job.

Mr Web Browser

Hi, I am Web Browser. Mr Web Page is too kind to give all the credit of fetching him to me. Actually, I am part of a team that does that. I just happen to be the most popular member of the team. There are many members of the team that work seamlessly in ensuring that you get the your web page like Mr Router and Mr Server.

I am more popular than other members of my team because I have the honor of directly interacting with you, dear user. You have me installed on your computers in the form of Chrome, FireFox or Safari. When you want to view a web page you open me and tell me which web page to view.

But the contents of the website do not reside within me. They are maintained and stored by Mr Server. I pass on your request to Mr Server. Once the contents are ready Mr Server returns them to me.

Now, you must know that Mr Server and I may be located hundreds of miles apart. We are also very different in our functioning.

I know how to create and display a web page. Mr Server stores the contents of the page like text, graphics, videos,
and links to other web pages.

Mr Server and I communicate using HTTP, Hypertext Transfer Protocol. HTTP provides the common language Mr Server and I both understand.

Once you tell me the address of a web page you wish to view, I convert your request into HTTP and send that to Mr Server. Only Mr Server knows how to process that request and convert it into content. So please let me bring Mr Server to talk to us.

Mr Server

Hello friends. I am Mr server. And I am honored to be here with you. I hardly get much attention as I am all the way in the back converting the HTTP request Mr Browser sends me into content. When I receive a HTTP request I immediately I get to work.

If the request is to fetch a webpage, I find all the elements of that webpage and return them to Mr Browser. Sometimes Mr Browser wants me save something instead of fetching like when you dear user wants to save some information on your email. And I know how to do that as well.

Once in a while, I have to reach out to fellow servers to get the content Mr Browser has requested. But I do not let Mr Browser worry about these details.

Sometimes I am not able to find the content Mr Browser requested. If that happens I convey that to him using HTTP code 404. Also at times I am just tired as I have too many requests to serve simultaneously. I may not be able to serve what Mr Browser has requested and convey that to him using HTTP code 500. I hope he does not take it personally.

I enjoy my work and I am glad to have this opportunity to talk about myself.

But please do know that there are other folks working tirelessly to bring Mr Web Page to you and I hope you get to meet them as well.