First, keep-alive connection
(1) When we use serial connection, such as loading four pictures, when loading the first picture, will establish a connection, after loading will close the connection, loading the second picture will also establish a connection before closing the connection, and so on, so it will consume a lot of time, http/1.0+ "Keep-alive" The connection will have a keep-alive detection mechanism when the first picture is loaded, so that the connection remains active without being shut down, so that it can continue to load and save time by increasing efficiency.
(2) A client that implements a http/1.0 keep-alive connection can keep a connection open by including a connection:keep-alive header request
(3) the client and the server can close idle keep-alive connections at any time, and can arbitrarily limit the number of transactions processed by the Keep-alive connection
Ii. Limitations of keep-alive connections
(1) in http/1.0, keep-alive is not used by default, the client must send a connection:keep-alive request header to activate the keep-alive connection
(2) The connection:keep-alive header must be sent with all messages wishing to maintain a persistent connection, or the server will close the connection after that request
(3) Keep-alive connection should not be established with a proxy server that cannot determine if the Connection header is supported
Three, dumb proxy and blind relay
The blind relay is to be forwarded regardless of the content of the HTTP message, but when forwarding the Connection header, if with the keep-alive attribute, then the agent does not understand the meaning of keep-alive, after the completion of a transaction (Request-response) , the agent will close the connection, and at this time, the client and the service side are thinking that the persistent connection has been established, but also silly waiting to continue to send, the agent is "dumb".
http/1.0+ "Keep-alive" connection