What happens when you type an URL in the address bar of a browser?

Seeli
3 min readNov 7, 2020

--

Ever wondered how are web pages are displayed on our browser, I would like to walk you through what actually happens in this article.

Say we want to view an website called www.gmail.com. We open our browser and type this URL in the address bar and our browser does these following steps to help us to see the requested webpage or website.

  1. FINDING THE IP ADDRESS

The URL is sent to the DNS where it searches for the IP address associated with the domain name given in the URL.

The searching happens in three places DNS first checks if we have visited that webpage or website before in the history of our browser cache.

if not found it searches in the OS cache followed by searching in router cache by ISP.

Even when it is not available there it searches in the root server of DNS hierarchy, authoritative name server,top level domain.

Finally either it obtains the IP address or say it is not found.

2)COMMUNICATION BETWEEN CLIENT AND SERVER

After which the TCP/IP 3-WAY HAND SHAKE is initiated, based on the request and response the actual transfer of the HTML files happens followed by the transfer of CSS and JAVA SCRIPT files, which is of the codes that needed to be rendered by the browser to be converted into the user understandable actual page that we see on the browser as the final result.

The GET request is given by the browser(HTTTP) to the server plays an important role after which the server responds with its state and starts to send the requested HTML,CSS,JAVASCRIPT contents.

3)RENDERING

When the HTML,CSS,JAVASCRIPT codes are received by the browser it sets the rendering engine to work.

HTML parser- to parse the HTML code to form the DOM tree.

CSS parser-to convert internal CSS code form CSSOM tree,

The DOM tree gives structure to the page and the CSSOM tree add style to it where our JAVASCRIPT ENGINE combinely adds functionality to interact with the user.

These tree finally converted into rendering tree then to form the layout of the webpage or website after which the painting of the web page starts.

4) DISPLAY

After the interpretation and formation of the rendering tree we have a layout by which the web page is painted with the structure, position, style along with all popups and user interactions.

After these process we obtain our requested web page or our website which actually seems to be long process happens in a few seconds.

--

--

Seeli
Seeli

No responses yet