Detailed introduction to Http--http 1.1 Gunicorn does not support HTTP 1.1

Source: Internet
Author: User

From the table in the previous section, we can see that one drawback of Gunicorn is that HTTP 1.1 is not supported. So what exactly is HTTP 1.1 about? When do we choose HTTP Server to consider the support for HTTP 1.1?

HTTP 1.1 vs. HTTP 1.0

A Web site may be receiving millions of user requests per day, in order to improve the efficiency of the system, HTTP 1.0 specifies that the browser and the server only a short connection, each request of the browser needs to establish a TCP connection with the server, the server completes the request processing and immediately disconnects the TCP connection. The server does not track each customer and does not log past requests.

However, this also creates some performance flaws, for example, a Web file containing many images does not contain the actual image data content, but only indicates the URL address of these images, when the Web browser accesses the Web file, the browser first to issue a request for the Web page file, When the browser resolves the HTML content in the webpage document returned by the Web server and discovers the image tag in it, the browser sends a request to the server to download the image data again, as shown in the URL address specified by the SRC attribute in the tag.

Obviously, the entire process of accessing a Web page file containing many images consists of multiple requests and responses, each of which requires a separate connection, each of which transmits only one document and image, and the last and the next request are completely detached. Even though the image files are small, it is a relatively time-consuming process to establish and close each connection between the client and server, and it can severely affect the performance of the client and server. When a Web page file contains applet,javascript files, CSS files and other content, it will also appear similar to the above situation.

To overcome this flaw in HTTP 1.0, HTTP 1.1 supports persistent connections, which can transmit multiple HTTP requests and responses on a single TCP connection, reducing the consumption and latency of establishing and shutting down connections. Multiple requests and responses for a Web page file that contains many images can be transferred in one connection, but requests and responses for each individual Web file still need to use their own connection. HTTP 1.1 also allows the client to make the next request without waiting for the last request result to be returned, but the server side must echo the response in the order in which the client requests are received, to ensure that the client can distinguish the response from each request. This also significantly reduces the time required for the entire download process. The exchange of information between the client and server based on the HTTP 1.1 protocol, as shown in.

As you can see, HTTP 1.1 overcomes the performance issues of HTTP 1.0, based on the advantages of HTTP 1.0. Not only that, HTTP 1.1 also improves and expands the functionality of HTTP 1.0 by adding more request headers and response headers. For example, because HTTP 1.0 does not support host Request header fields, Web browsers cannot use host header names to explicitly indicate which Web site to access on the server, so you cannot use a Web server to configure multiple virtual Web sites on the same IP address and port number.

After adding the host Request Header field in HTTP 1.1, the Web browser can use the host header name to explicitly indicate which Web site to access on the server, which enables multiple virtual Web sites to be created on a single Web server with a different hostname on the same IP address and port number. HTTP 1.1 Persistent connection, also need to add new request header to help implement, for example, when the value of the connection request header is keep-alive, the client notifies the server to keep the connection after returning the result of the request, and when the value of the connection request header is close, The client notifies the server to close the connection after returning the result of this request. HTTP 1.1 also provides request headers and response headers related to mechanisms such as authentication, state management, and cache caching.

    • The old standard of the HTTP protocol is http/1.0, the most common standard currently is http/1.1. http/1.1 is an upgrade on the basis of http/1.0, adding some features, fully compatible with http/1.0. http/1.0 does not support file breakpoint continuation, the majority of the current Web server has adopted the http/1.1.

PS:RANGE:bytes is a new addition to http/1.1, http/1.0 each transfer file starts at the beginning of the file header, which is 0 bytes. RANGE:BYTES=XXXX indicates that the server is required to start the transmission from the file XXXX byte, which is what we call a continuation of the breakpoint.

So now, do you think Gunicorn does not support HTTP1.1 can accept it? Gunicorn is excellent, but this is the biggest drawback.

Detailed introduction to Http--http 1.1 Gunicorn does not support HTTP 1.1

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.