1. Binary Sub-framehttp1.x is a text format transmission, HTTP2 in binary format, and is not sent over a frame, and the frame can be reassembled according to the head stream identity.
2. Single Long ConnectionThe same domain name uses a TCP connection, (http1.x uses 6-8 TCP connections, the browser to reduce consumption, restrictions), regardless of the number of resources requested, can reduce the delay caused by the handshake, reduce the network overhead of creating multiple TCP connections, improve throughput
3. multiplexingHttp1.x is equivalent to a single lane, the request on the same connection is executed serially HTTP2 is equivalent to multiple lanes, and requests on the same connection can be executed in parallel. Because the request is binary-framed, each frame has a stream number. The same request and response frames must be ordered, and the frames of the different requests can be interspersed with each other. It is then reorganized according to the stream number.
4. Head compressionUsing Hpack to compress the head, use the Header table to store the header field, only the HTTP header field will be sent if the data in the Header table changes or is sent out of date. The first table is divided into static tables and dynamic tables, static tables contain characters commonly used segments, dynamic tables contain non-characters commonly used segments such as custom fields, and data in dynamic tables is incremented or modified when fields are added or changed.
5. Service-side pushThe client requests resource X, and the server determines that the client needs additional resources and can proactively push these resources. The client needs to explicitly allow the server to enable push functionality. Also, the client can send a rst_stream frame to interrupt the push stream, pushing the same policy restrictions for example, when requesting a index.html page, the server simultaneously pushes Index.js and index.css to the browser. When the browser parses HTML to request index.css and index.js, it can be read directly from the cache
HTTP2 new Features