What happened in the process of receiving from the input URL to the browser?
What really happens if you navigate to a URL
Both of the above articles are well understood and worth reading.
The next step is to summarize this process:
1, first, will query the cache, if the cache exists, then respond directly, otherwise continue the following process;
2. When sending a URL request, whether the URL is a Web page URL or a URL for each resource on a Web page, the browser will open a thread to process the request and start a DNS query on the remote DNS server. This enables the browser to obtain the corresponding IP address of the request. The DNS lookup process is as follows: Browser cache, system cache, router cache, ISP DNS cache, recursive search
3, the browser and the remote ' Web ' Server through the ' TCP ' three handshake negotiation to establish a ' TCP/IP ' connection. The handshake consists of a synchronization message, a synchronous-response message, and a response message, which is passed between the browser and the server in three messages. The handshake is first attempted by the client to establish communication, then the server answers and accepts the client's request, and finally the client sends a message that the request has been accepted.
4. Once the ' TCP/IP ' connection is established, the browser sends a ' GET ' request for ' HTTP ' to the remote server through the connection. The remote server locates the resource and returns the resource using an HTTP response, and the HTTP response status of 200 indicates a correct response.
5. At this point, the ' Web ' server provides resource services and the client begins to download resources. Cached if the resource is cacheable.
6. After the response is returned, it enters the front-end module that we care about, and the browser decides how to handle these responses (for example, it is an HTML page, a picture, a piece of music). simply put, the browser parses ' HTML ' to generate ' DOM tree ', followed by css Rule Tree , and ' JavaScript ' can operate ' Dom ' based on ' Dom API '
What happened in the process of receiving from the input URL to the browser?