Excerpt from the explanation of the HTTP keep-alive Mode

Source: Internet
Author: User

1. What is the keep-alive mode?

The HTTP protocol adopts the "request-response" mode. When the common mode is used, that is, the non-keepalive mode, a new connection is required for each request/response client and server, disconnect immediately after completion (the HTTP protocol is connectionless). When the keep-alive mode (also known as persistent connection and connection reuse) is used, the keep-alive function keeps the client-to-server connection valid. When a subsequent request to the server appears, the keep-alive function avoids or reestablishes a connection.



In HTTP 1.0, "connection: keep-alive" must be added to the HTTP header to enable keep-alive. In HTTP 1.1, keep-alive is enabled by default. If "connection: close. Currently, most browsers use the http1.1 Protocol. That is to say, keep-alive connection requests are initiated by default. Therefore, whether a complete keep-alive connection can be completed depends on the server settings.

Ii. Advantages of enabling keep-alive

From the analysis above, enabling the keep-alive mode is certainly more efficient and has higher performance. This avoids the overhead of establishing/releasing connections.


Author: Eric

Original post address: http://blogread.cn/it/article/6296? F = WB


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.