URL to a page showing the input, which occurred in the middle of what?

Note: Chrome includes: a main browser process, a process GPU, a network process, more than the rendering process, multiple plug-in process

1. User input URL, the browser will judge based on information entered by the user is searching or URL, if it is to search for content, it will search for content + default search engine to synthesize new URL; content if a user enters the URL comply with the rules, the browser URL protocol based on synthetic legitimate URL in this content plus agreement.

2. The user finishes typing, press the Enter key, the browser navigation bar displays the loading state, but before rendering a page or pages, this is because the new page response data has not yet been obtained.

3. The process of building a browser request line information will be through inter-process communication (IPC) the URL request to the network processes GET /index.html HTTP1.1

4. Network process to get URL, go to the local cache to find whether there is a cache file, if any, intercepts the request, direct 200 return; otherwise, enter the network request process.

5. DNS network processes the request to return the domain name corresponding to the IP address and port number, if before the DNS cache service cached data current domain information, it will directly return the cached information; otherwise, initiating get out of the domain name resolution based on IP and port number, If there is no port number, http default 80, https 443. If the default is https request, also need to establish a TLS connection.

6.Chrome there is a mechanism with a domain name can make up to six simultaneous TCP connections, if there are 10 requests occur at the same domain name, of which four requests are queued to enter the state, the request until the completion of ongoing . If fewer than six current request, will establish a TCP connection directly

7.TCP three-way handshake to establish a connection, the TCP header plus --- HTTP request includes a source port number, destination port number and the program number for integrity check data, downward transmission.

8. The IP network layer coupled to the packet header includes a source IP address --- and destination IP address, transmission continues down to the bottom

9. underlying physical network transmission to the destination host server

10. The host object server network layer receives a packet, parses the IP header, identify the data portion of the data packet transmission unlock up to the transport layer

11. The purpose of the transport layer host server to obtain the data packet, parses the TCP header identifying a port, will unlock the data packet transmission up to the application layer

12. The state of the application layer header and the resolution request HTTP request body, if redirection is required, HTTP HTTP response data is returned directly or code301 302, together with the Location field in the request header in the redirected address, browser based code and Location redirection operation performed; if not whether to redirect the request to determine the first server based on the value of IF-None-Match header resource request is updated, if there is no update, status code 304 is returned, corresponding to report sent Browse before the cache can also be used, the new data is not returned; otherwise, it returns the new data, status code 200, and if you want the browser to cache data, then it is added to the corresponding fields in the header: cache-Control: Max- age = 2000 and the response data along the application layer - transport layer - network layer network layer --- - transport layer - the sequence returns to the application layer of the network processes.

13. The data transfer is complete, TCP four wave disconnected. If the browser or server, add the following information in the HTTP header, TCP has been connected. Keep the TCP connection can save time next time you need to establish the connection, suggesting that resource loading speed Connection: Keep-Alive

14. The network processes the acquired data packet parsing, according to the response Content-type header to determine the type of the response data, if the stream type byte, to the request to the download manager, the navigation flow ends, no longer; if it is text / html type, you will notice the browser process to get the document ready to render.

15. The browser process to get a notification, based on the current page if B is open from page A and page A and whether it is the same site (domain name and root agreement is considered as the same site), if the above conditions are met, and he was restored with the process before the web page, otherwise create a new separate rendering process

16. browser will send a message "to submit documents" to the rendering process, the rendering process receives the message, it will establish the transmission of data and network processes, "pipeline", the document data transfer is complete, the rendering process will return to "confirm to submit" a message to the browser process.

17. After the browser receives the message "Confirm Submit", the page will be updated browser state, including the state security, URL address bar, forward backward state history, and with the new web page, the web page is at this time blank page.

18. The process of rendering the document parsing and sub-page resource loading, turned into HTML through the HTML parser DOM Tree (something similar binary tree structure), CSS transferred in accordance with the rules of CSS and CSS interpreter to CSSOM Tree, two tree combine to form render Tree (HTML does not include the specific elements and element specific location to be drawn), by Layout can be calculated for each element color position in a specific width and height, combined, start drawing, and finally displayed on the screen, a new page is displayed.

Guess you like

Origin www.cnblogs.com/zhswater/p/11361370.html