NOTE
2.14 What Happens After Entering a URL in the Browser
After a URL is entered, the browser parses it, resolves DNS, establishes a connection, and requests the resource. These notes follow that sequence step by step.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Process Overview

-
Parse the URL.
For example, https://www.baidu.comorhttps://www.baidu.com/->https://www.baidu.com/index.html, whilehttps://www.baidu.com/dirfirst checks whether there is a file nameddir, and if not, checks for a directory. -
DNS domain-name resolution.
DNS -
Establish a TCP connection with a three-way handshake.
TCP Three-Way Handshake
ARP
IP Protocol -
If it is HTTPS, establish an HTTPS connection as well.
HTTPS -
After the TCP connection is established, generate an HTTP Request to request the HTML.
HTTP Message Format.md -
The server returns an HTTP Response and the browser obtains the HTML code.
-
The browser parses the HTML and requests resources referenced by the HTML, such as JS, CSS, and images.
-
Use JavaScript to request data from the APIs.
-
Nginx receives the request and forwards it to the upstream API gateway. The API gateway forwards it to the upstream server. The upstream server checks Ehcache, Redis, and the database, and the result is returned step by step.
-
The browser renders the page and presents it to the user.
-
Close the connection with the TCP four-way teardown.
TCP Four-Way Teardown
2. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub