TomoLink
CompaniesSwiggySystem DesignWhat Happens When You Type google.com Into a Browser?
System Design
Mediumtechnical-interviews

What Happens When You Type google.com Into a Browser?

30 minsNetworkingWeb Browsers
30 mins
1 sections
Networking, Web Browsers

Overview

  • First up, you type the website address in the browser’s address bar.
  • The browser checks its cache first. If there’s a cache miss, it must find the IP address.
  • DNS lookup begins (think of it as looking up a phone number). The request goes through different DNS servers (root, TLD, and authoritative). Finally, the IP address is retrieved.
  • Next, your browser initiates a TCP connection like a handshake. For example, in the case of HTTP 1.1, the client and server perform a TCP three-way handshake with SYN, SYN-ACK, and ACK messages.
  • Once the handshake is successful, the browser makes an HTTP request to the server and the server responds with HTML, CSS, and JS files.
  • Finally, the browser processes everything. It parses the HTML document and creates DOM and CSSOM trees.
  • The browser executes the JavaScript and renders the page through various steps (tokenizer, parser, render tree, layout, and painting).
  • Finally, the webpage appears on your screen.
What Happens When You Type google.com Into a Browser? [Medium] | Swiggy System_design | TomoLink