The Mystery Behind Typing `https://www.google.com` and Hitting Enter
Introduction
The process of typing in a URL and watching a webpage load quickly has become a standard aspect of our online experience in the modern digital world. However, have you ever stopped to think about the detailed series of actions that take place in the background when you hit Enter after entering a URL such as https://www.google.com? Follow along as we explore the amazing path of a web request, from the first keystroke to the smooth presentation of material on your display.
DNS Request
The first thing your browser does when you type a URL into it and hit Enter is resolve the domain name to an IP address. This crucial step involves sending a DNS (Domain Name System) lookup request from your browser to a DNS server. The server then starts translating the domain name (e.g., www.google.com) into the address that corresponds to it (e.g., 172.217.3.228).
TCP/IP
Once the IP address is obtained, your browser uses this address to create a TCP (Transmission Control Protocol) connection with the server. When it comes to reliable connection between your browser and the server, TCP is essential. It accomplishes this by making connection establishment easier, dividing data into packets, and carefully reassembling them at the desired location.
Firewall
Before the connection is made, it might pass through a firewall, which acts as a barrier between the internet and your network. As a gatekeeper, this firewall enforces strict security guidelines to protect against potentially dangerous activity and illegal access.
HTTPS/SSL
A secure connection is established between your browser and the server through SSL/TLS (Secure Sockets Layer/Transport Layer Security) protocols when you connect to a website using HTTPS (Hypertext Transfer Protocol Secure), the encrypted version of HTTP. By ensuring that the data is encrypted during transmission between your browser and the server, this process protects it from being intercepted by malicious parties.
Load Balancer
When a website encounters a significant surge in traffic, a load balancer may be utilized to disperse incoming requests among several servers. By preventing any one server from receiving too many requests, this tactic improves scalability, performance, and dependability.
Web Server
A web server like Apache, Nginx, or Microsoft IIS launches to handle the request as soon as the connection is made and the request reaches the server. The requested resources, such as scripts, pictures, or HTML files, are retrieved by the web server and sent back to the browser right away.
Application Server
Sometimes, especially with dynamic websites or web apps, the request needs to be handled by an application server. In response to the request, this specialized server generates dynamic content, interacts with databases, runs server-side scripts, and sends the result back to the web server so that the browser may view it.
Database
The application server works with the database server to carry out the necessary actions when the request involves getting or changing data stored in a database. This could involve requesting information from the database regarding the user, the product, or any other relevant details needed to process the request.
Conclusion
To sum up, the path taken by a web request consists of multiple critical steps, all of which work together to provide visitors with a safe and easy browsing experience. Every component, from DNS resolution to database data retrieval, is essential to getting the requested material to your browser. Understanding this complex process helps us better grasp web technologies and gives us the ability to diagnose problems and improve performance in our own web apps.
Subscribe to my newsletter
Read articles from Lawson Israel Pascal directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by