http/1.0+ "Keep-alive" connection

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.