A step-by-step explanation of how browsers work.

This article is written for those curious minds who want to know the technical details of what happens inside a browser while using it.

So we enter the address of the following site – practicum.yandex.com – in the address bar of your browser and press “Enter”. So what?

Every website is physically stored somewhere on a server. As soon as the browser receives the website address, it must find out which server has that address’ information. But what we call an “address” here isn’t really an address at all – it’s a domain name.

👉 Imagine we are really hungry and decide to get a pizza. Instead of telling the driver the exact address, like 123 Food Street, we simply ask you to go to the Practicum Pizza House. We do something similar when we type the name of a website into our browser, and the job of the browser is to figure out how to get there.

Big Data jobs

Now the browser needs to determine where the request will be sent based on the domain. It needs to know the IP address, which is an abbreviation for Internet Protocol address. Each server has one, and it looks like this:

32,184,208,243

Using these numbers, computers are able to communicate with each other and send what they want information. The browser can be used to find out which IP address corresponds to a website:

  1. First, it checks to see if the user has previously visited this site. If so, the browser retrieves the IP address from the user’s history. It’s as if many trips are at the same pizza restaurant, the driver will probably remember the road.
  2. If the site has not been visited, the browser will check the operating system configuration files. Sometimes, to speed up this process, administrators assign IP addresses to the computer itself.
  3. If the configuration files do not contain an IP address, the browser then looks for the latest router addresses that the computer uses to connect to the network.
  4. If it does not find it, the browser sends a request to the DNS server that is sure to have it. However, this takes more time than the other ways we discussed above.

1. Why do business AI projects fail?

2. How will artificial intelligence trigger the next wave of healthcare innovation?

3. Machine learning using a regression model

4. Most popular computing platforms in 2021, other than Kaggle

A Domain Name System (DNS) server is a network service model to answer one question: what is the IP address of this particular domain? There are many DNS servers on the Internet. Each of them contains information about its own part of the network. If the nearest server does not have the required domain records, it responds by saying “don’t know” and gives a larger DNS address that can help. Eventually, the browser finds a DNS server that gives the IP address of the server it needs.

Is this article too long? Break it down and read one of our articles instead: How the Internet works

The browser has finally found the IP address of the desired website server. It sends a request to this address that says something like, “I know you have this domain. I need a page for this domain that has these parameters. Give it to me.”

To ensure safety and to ensure that no one abducts anyone information along the way, the browser and server agree to encrypt all messages with each other. When “https” appears at the beginning of the address, you know that this encryption is in place. As soon as all these formalities are gone, the server replies, “Yes, of course, I’ll send everything right away.” Unfortunately, sometimes the address is incorrect and the server cannot find the specified page. In these cases, it replies, “I don’t have the required page, I can’t help it!” When this happens, the browser will show us a 404 error page.

When the server receives the request from the browser and everything is fine with the address, it starts preparing to send the data. To do this, it checks which server instances are responsible for this domain and tells them, “Compile this page for me so I can send it to your browser.” For example, a server can have a WordPress or PHP processor that builds a page from different pieces of code on the fly.

Once the server’s internal programs have given the server everything they need, it’s time to send the result to the browser.

To do this, the server splits all the data into small packets that are only 8 kilobytes each! The server marks these packets with a number and then sends them to the browser. This process allows multiple packets to be sent simultaneously, which in turn allows for faster download times. Assigning numbers to packets is necessary for the browser to be able to assemble all packets correctly and return the original document. If a packet is lost along the way, the browser tells the server, “I dropped the packet, resend it.” This process continues until the browser has collected all the required packets.

When the browser receives all the packets, it parses the result into the following:

  • HTML
  • CSS
  • JavaScript
  • Other code that the browser can execute

This is necessary for the browser to build the Document Object Model (DOM) feature on the page. The DOM contains information about:

  • All page elements
  • The ratio of the different side elements
  • How the elements interact with each other
  • What elements can do and how they react to user actions

Based on the DOM, the browser eventually renders the page on the screen:

The browser has to do one more thing: take the DOM, find all the visible elements, and do them for the user. If JavaScript is included, it can be run either before rendering or after, depending on how the script works.

Sometimes, while rendering a page, the browser may request information from the server again. In this case, the browser outlines what it already has, and then the rest is rendered when the requested information arrives. If some information is missing, there may be blank sections on the page. For example, when the browser has already rendered the page navigation menu and main article, but still downloads the YouTube video.

Once the page is loaded and the browser has rendered everything, we will see the final result. But even after that, the browser can continue working with the page. For example, it can:

  • Run the JavaScript code
  • Download music or video in the background
  • Download performance by improving the frequently visited pages of this site in the background
  • Enter the information into cookies or local storage
  • Collect information about user behavior on this page
  • Or do something else that the programmers have implemented

LEAVE A REPLY

Please enter your comment!
Please enter your name here