Today I want to comb the story of visiting a webpage that happened.
1. First, to access a Web page, you will enter the address of the page, that is, the domain name (such as www.baidu.com)
2. DNS resolution (domain name resolution) by entering the domain name to find the IP address of the webpage (e.g. 192.168.1.1)
3. The browser and the server through the three-time handshake protocol to establish a connection (TCP protocol), here can be cached by the cookie status information, maintain the last connection status
(online looking for a picture)
4. The browser sends HTTP request Content (HTTP protocol) to the server
(Feel free to grab a bag when example)
Here is the message that the front end needs to send the data back to the station
5. The server returns HTML data
The first row here indicates that the requested server returned data successfully.
6. Browser Display HTML page
This page is already displayed when the browser does not fully accept all HTML documents.
7. Browser gets embedded object in HTML
When the browser displays the HTML document, it will resend the request to get the embedded objects, slices, CSS, JS files and so on according to the contents of the HTML document, so the page delay will sometimes occur.
8. The browser sends an asynchronous request
The browser remains in contact with the server even after the page is completed (long polling keeps the connection)
9. Close the browser, the browser and the server four times handshake protocol close link
(Online theft map)
Simply talk about the process of accessing a Web page