Principles of keepalive

Source: Internet
Author: User
Principles of keepalive

Both http1.0 and http1.1 support keepalive. Http1.0 requires "connection: keep-alive" header to be added to the request, whereas http1.1 supports this header by default.

The data interaction process supported by http1.0 keepalive is as follows:

A) when the client sends a request, the HTTP Version of the request is 1.0. The request contains a header: "connection: keep-alive".

B) the Web server receives the request The HTTP protocol 1.0 and "connection: keep-alive" in is considered to be a persistent connection request, and "connection: keep-alive" will be added to the header of the response. The established TCP connection will not be closed.

C) when the client receives a response from the web server that contains "connection: keep-alive", it considers it a persistent connection and does not close the TCP connection. Use the TCP connection to send the request again. (Jump to ))

The data interaction process supported by http1.1 keepalive is as follows:

A) when the client sends a request, the HTTP Version of the request is 1.1.

B) when the HTTP protocol in the request is 1.1, the web server considers it a persistent connection request and adds "connection: keep-alive" to the header of the response. The established TCP connection will not be closed.

C) the client receives Response contains "connection: keep-alive", which is considered to be a persistent connection and does not close the TCP connection. Use the TCP connection to send the request again. (Jump to a)

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.