The difference between HTTP1.0, HTTP1.1 and HTTP2.0

1. The difference between HTTP1.0 and HTTP1.1

1. Long connection

  • HTTP 1.1 supportslong connections. Each connection can send multiple requests and responses. Connection:Keep-Alive is enabled by default a>
  • HTTP1.0 defaults toshort connection, each request needs to establish a TCP connection

2. Caching

  • HTTP 1.0 mainly uses If-Modified-Since/Expires as the standard for cache judgment.
  • HTTP 1.1 introduces morecache control strategiessuch as Entity tag / If-None-Match and more to choose from Cache headers to control caching policy

3. Pipeline

  • Long connections based on HTTP 1.1 make request pipelines possible. Pipelining allows requests to be transmitted in "parallel", but responses must be returned in the order in which the requests are issued. Performance has been improved to a certain extent.

4. Add host field

  • Enables one server to be used to create multiple Web sites

5. Status code

  • Added 24 new error status response codes

6. Bandwidth optimization

  • In HTTP1.0, there are some phenomena that waste bandwidth. For example, the client only needs a part of an object, but the server sends the entire object and does not support the resume function.
  • HTTP 1.1 introduced the range header field in the request header, which allows only a certain part of the resource to be requested, that is, the return code is 206 (Partial Content)

2. The difference between HTTP2.0 and HTTP1.1

1. Binary division

  • Add a binary recovery layer between the application layer (HTTP/2.0) and the transport layer (TCP or UDP) to break through the performance limitations of HTTP1.1, improve transmission performance, and achieve low latency and high throughput.

2.MultiPlexing

  • Allows multiple request-response messages to be initiated simultaneously through a single HTTP/2 connection. This powerful feature is based on the "unary framing" feature.

3. Header compression

  • HTTP1.1 does not support the compression of header data. HTTP/2.0 uses the HPACK algorithm to compress the header data, so that the data size is smaller and the transmission on the network will be faster. Efficient compression algorithms can greatly compress headers, reduce the number of packets sent and thereby reduce delays.

4. Server push

  • In HTTP/2, the server can send multiple responses to a client request, that is, the server can push additional resources to the client without explicit requests from the client.

Guess you like

Origin blog.csdn.net/daydayup858/article/details/133944002