What happens when a user enters a URL on a web page

When a user enters a URL on a web page, the following processes are experienced:

URL parsing: The browser parses the URL entered by the user and divides it into protocol, host name, port number, and path.

DNS resolution: The browser obtains the server IP address through domain name resolution.

Establish a TCP connection: The browser establishes a TCP connection through the HTTP/HTTPS protocol.

Send HTTP request: The browser sends an HTTP request to the server, including the request method, request header, request body, etc.

Server processing request: After receiving the request from the browser, the server processes it according to the request information and server configuration, and returns the corresponding response content and response status code.

The browser receives the response: After the browser receives the response from the server, it starts to parse the response content.

Rendering the page: If the request is an HTML page, the browser starts to parse the page structure, lays out and renders it, and finally presents the page to the user.

Disconnect TCP connection: When the browser receives the response, it disconnects the TCP connection and releases resources.

In general, when a user enters a URL on a web page, the browser will perform a series of operations, send the user's request to the server and receive a response, and finally present the page to the user

Guess you like

Origin blog.csdn.net/weixin_45090657/article/details/130190251