http notes sorting-what happens after entering the URL and pressing enter

1. The HTTP protocol is based on the underlying TCP / IP protocol, so an IP address must be used to establish the connection;

2. If you do not know the IP address, you must use the DNS protocol to resolve the IP address, otherwise the connection will fail;

3. After a TCP connection is established , data will be sent and received sequentially . Both the requester and the responder must construct and parse the message according to the HTTP specification;

4. In order to reduce the response time, every link in the whole process will have a cache, which can achieve "short circuit" operation;

5. Although the HTTP transmission process in reality is very complicated, it can still be simplified into the "two-point" model in theory in theory.

 

What happened after clicking the page link in the browser?

The browser judges whether it is an ip address or not, and then performs domain name resolution, and in turn through the browser cache, system cache, host file, or the DNS request is not found to obtain the IP resolution (the browser that failed to resolve attempts to change to another DNS server. (Failed to enter the error page), it is possible to obtain the IP address of the CDN server. When accessing the CDN, first check whether it is cached, the response user is cached, the cache cannot be cached, the cache is invalid or no cache, and the source is returned to the server. Route to the nginx access layer through the external network management of the firewall. The existing load in the ng cache is directly put back, and the non-existent load is sent to the web server. After the web server receives the request, post-processing, the path does not exist 404. Existing return results (the server will also have redis, ehcache (inside and outside heap cache), disk and other cache strategies). Return the same way, CDN joins the cache to respond to the user.

 Connection establishment process:

Published 127 original articles · Likes 24 · Visits 130,000+

Guess you like

Origin blog.csdn.net/Linzhongyilisha/article/details/105500977