Some differences between HTTP1.0 and HTTP1.1
-
HTTP1.0 mainly uses if-modified-since,Expires in the header. HTTP1.1 introduces more cache control policies such as Entity tag. If-unmodified-since, if-match, if-none-match, etc.
-
Bandwidth optimization and network connection, HTTP1.0, there are some waste of bandwidth, such as the client only needs a part of an object, and the server will send the whole object over, and does not support breakpoint continuation function, HTTP1.1 is introduced in the request header range header field, which allows only a part of the resource request, The return code is 206 (Partial Content), which makes it easy for developers to make the most of bandwidth and connections. Error notification management, HTTP1.1 added 24 error status response code, such as 409 (Conflict) indicates that the requested resource and the current state of the resource Conflict; 410 (Gone) Indicates that a resource on the server is permanently deleted.
-
The Host header processing, in HTTP1.0, assumes that each server is bound to a unique IP address, so the URL in the request message does not pass the hostname. However, with the development of virtual hosting technology, there can be multiple virtual hosts (multi-homed Web Servers) on a physical server, and they share the same IP address. HTTP1.1 both Request and response messages should support the Host header field, and an error (400 Bad Request) will be reported if there is no Host header field in the Request message.
-
HTTP 1.1 supports long Connections and Pipelining processing that delivers multiple HTTP requests and responses over a SINGLE TCP connection, reducing the cost and latency of establishing and closing connections. Connection: keep-alive is enabled by default in HTTP1.1, somewhat compensating for the fact that HTTP1.0 creates a Connection on every request.
Some existing problems with HTTP1.0 and 1.1
-
Http1.x requires reconnection every time data is transferred, which adds a significant amount of latency, especially on mobile.
-
Http1.x transmits data in plain text. The client and server cannot verify the identity of each other.
-
When http1.x is used, the content in the header is too large, which increases the transmission cost to some extent, and the header does not change much with each request, especially on the mobile end.
-
Although http1. x supports keep-alive to compensate for the delay caused by multiple connection creation, the excessive use of keep-alive also imposes a significant performance burden on the server, and can significantly affect the performance of services where a single file is constantly requested (such as image hosting sites). Because it keeps the connection unnecessarily long after the file is requested.
Some differences between HTTPS and HTTP
-
For HTTPS, you need to apply for a certificate from a CA. Generally, a free certificate is rare and requires a fee.
-
HTTP runs on TOP of TCP, and all transmitted content is in plain text. HTTPS runs on top of SSL/TLS, and SSL/TLS runs on top of TCP, and all transmitted content is encrypted.
-
HTTP and HTTPS use completely different connections and use different ports, the former 80 and the latter 443.
-
HTTPS can effectively prevent carrier hijacking, solving a big problem of anti-hijacking.
New features of HTTP2.0
-
The new Binary Format, http1.x parsing is text-based. There are natural defects in format parsing based on text protocol. There are various forms of text expression, and many scenarios must be considered in order to achieve robustness. Binary is different, only recognizing the combination of 0 and 1. Based on this consideration HTTP2.0 protocol parsing decision to adopt binary format, implementation is convenient and robust.
-
MultiPlexing means that each request is used as a connection sharing mechanism. A request corresponds to an ID. In this way, a connection can have multiple requests. The requests of each connection can be randomly mixed together, and the receiver can assign the requests to different server requests according to the REQUEST ID.
-
HTTP2.0 uses encoder to reduce the size of the headers that need to be transferred. The communication parties cache a table of header fields. This avoids duplicate header transmission and reduces the size of the required transmission.
-
Server push, HTTP2.0 has server push functionality.