Talk about long connections in the HTTP protocol, short connections

Source: Internet
Author: User

1, previous misunderstanding:

Previously heard that the HTTP is divided into long connections and short connections, the simple long-term connection is the request can be reused, short connection is only one request, and then the protocol is closed, but in fact this sentence is only half, the HTTP protocol is based on the request/Response mode, as long as the server gave a response, This HTTP connection is over, there is no long connection at all so to say,

The reason why the network said that the HTTP long connection and short connection is essentially a TCP connection, he is the transport layer, then the misunderstanding on the front has the answer

First, the long connection is to reuse, how to reuse it, the head of the connection set to Keep-alive (now HTTP default is a long connection), and then multiple HTTP requests will be reused a TCP connection,

Summarize:

Long connections are multiple HTTP requests multiplexing a TCP connection

A short connection is an HTTP request that corresponds to a TCP connection

Talk about long connections in the HTTP protocol, short connections

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.