Persistent connection and pipelining of HTTP

Source: Internet
Author: User
Tags keep alive
1. What is a persistent connection? (Keep alive mode)
HTTP1.1 Specifies that long connections are maintained by default (HTTP persistent connection, also translated for persistent connections); Data transfer is done to keep the TCP connection continuously open (no RST packet, no four handshake), waiting for the same domain name to continue to use this channel to transfer data The opposite is a short connection.

HTTP 1.1 version supports persistent Connection version 1.0 is not supported
Differences from non-persistent connections:
Persistent connections make client-to-server connections persistent and avoid re-establishing connections
Greatly reduces the establishment of connections and the delay of closing. The HTTP connection is built on top of the TCP protocol, which requires three handshakes to establish a TCP connection and four waves to close the TCP connection. It all takes time.

2. What is pipeline
The pipelined mechanism must be completed through a permanent connection (persistent connection) and only http/1.1 support this technology (http/1.0 not supported)
In the case of a persistent connection, the delivery of a connection message is similar to
Request 1, Response 1, request 2, Response 2
Pipelining: A message on a connection becomes something like this
Request 1, request 2, request 3, respond 1, Response 2, Response 3

Note

A, the difference between persistent and pipelined is that a disadvantage of persistent connections is that the request and response are executed sequentially, and request 2 is sent only after the response of request 1 is received, and pipelining does not need to wait for the last request to respond before the next request can be made. Implements a parallel send request.

b, only get and head requirements can be pipelined, while post is limited

C, the first time you create a connection should not start the pipeline mechanism, because the other (server) does not necessarily support the http/1.1 version of the Protocol

D HTTP1.1 requires the server side to support pipelining, but does not require the server side of the response is also pipeline processing, only requires that the pipeline of requests do not fail, and now many server-side and agent of the pipeline support is not good, modern browser chrome and Firefox default does not turn on pipeline support.

Related Article

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.