Exploring Web Architecture: From URL Click to Page Load

Step-by-Step Process of What Happens When You Click on a URL
1. URL Parsing
When you click on a link (URL), the first thing your browser does is parse the URL. It checks for the protocol (HTTP, HTTPS, FTP, etc.) and identifies the domain name and the path to the resource.
2. DNS Lookup
Once the URL is parsed, the browser needs to know the IP address of the domain (www.example.com
). To do this, it sends a request to a DNS server. The DNS (Domain Name System) translates the domain name into an IP address (e.g., 192.0.2.1
).
3. TCP Connection & Handshake
Now that the browser knows the IP address, it establishes a connection with the server using TCP (Transmission Control Protocol). The connection begins with a three-way handshake:
The browser sends a SYN (synchronize) signal to the server.
The server responds with SYN-ACK (synchronize-acknowledge).
The browser sends back an ACK (acknowledge), completing the handshake.
4. Sending the HTTP Request
After establishing the TCP connection, the browser sends an HTTP request to the server for the resource specified in the URL. This request contains the method (GET, POST), headers (which provide additional info like the type of browser), and other metadata.
5. Server Response
The server processes the HTTP request, finds the requested resource, and sends back an HTTP response. The response includes the status code (e.g., 200 OK for success, 404 Not Found for missing pages), the headers (content type, length), and the content (HTML, CSS, JavaScript, etc.).
6. Rendering the Content
Once the browser receives the HTTP response, it starts rendering the content. This involves:
Parsing the HTML structure.
Fetching any additional resources (like CSS, JavaScript files, or images).
Executing JavaScript to make the page interactive.
7. Page Loaded
Finally, the page is fully loaded in your browser, and you can view and interact with it.
Conclusion
the next time you click on a link, you’ll have a better understanding of the complex process happening behind the scenes. From parsing the URL to loading the content, your browser is doing a lot of work to bring the web to your fingertips. Appreciating this process helps you see how intricate and powerful the web truly is.
Subscribe to my newsletter
Read articles from Mahesh Velishala directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
