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