Make a summary every day, persistence is victory!
/** @date 2021-06-28 @description 图 文 HTTP - Chapter 5 - A Web server that works with HTTP */Copy the code
one
HTTP / 1.1
The specification allows an HTTP server to be set up using a virtual servermultiple
The Web siteThe domain name
And finally, convert toThe IP address
So it’s possibleMultiple domain name
Points to theThe same
The IP address, for proper access, needs to be in theThe Host first
Of the specified host name or domain nameURI
- Proxy: The basic behavior of a proxy is that after receiving a request from a client,
forwarding
To other servers, without changing the URI, directly forward to the server holding the resource ahead (source server) - During HTTP communication, multiple proxy servers can be cascaded. In this case, requests and responses are forwarded through several chained servers, which need to be forwarded
Via
The header field is marked byHost information
5. Classification of agents: according toWhether to use caching
withWhether to modify the packet
To classify
Whether to use cache: Whether to store resource copies on the proxy server when forwarding responses transparent: Whether to modify the packets when forwarding requests or responses without any processing is called transparent proxyCopy the code
- Gateway: Similar to a proxy server, but a gateway can be used by a server on a communication line
The HTTP protocol
Encryption can be improved over the communication line between the client and the gatewaysecurity
- The tunnel can establish a communication line with other servers as required. Encryption means can be used to communicate, ensuring that the client and the server can communicate
Secure communication
- Caching is stored on the proxy server or local client
A copy of the resource
, and can be read directly when requesting resources, reducing the access to the source server and saving communication traffic and time - In the proxy server
Cache server
When receiving the response from the source server, the resource is saved and the resource in the cache server is directly used in the subsequent access, which can reduce the processing of the request by the source server
10. The cacheeffectiveness
: When the source server has updates, the resource copy of the cache server is not the latest resource. Therefore, it is necessary to determine the validity of the resource. If there are updates, obtain the resource copyThe latest
Resources, noDirect return
Cache resources on the server
11. The client
Cache: also available inThe client
By keeping a copy of the resource, you do not need to request the same resource to the server each time, but also need to confirm the cached resource to the source servereffectiveness