HTTP/2 (originally named HTTP/2.0) is a major revision of the HTTP network protocol used by the World Wide Web. It was derived from the earlier experimental SPDY protocol, originally developed by Google. HTTP/2 was developed by the HTTP Working Group (also called httpbis, where "bis" means "twice") of the Internet Engineering Task Force (IETF).
HTTP/2 is the first new version of HTTP since HTTP/1.1, which was standardized in RFC 2068 in 1997. The Working Group presented HTTP/2 to the Internet Engineering Steering Group (IESG) for consideration as a Proposed Standard in December 2014, and IESG approved it to publish as Proposed Standard on February 17, 2015 (and was updated in February 2020 in regard to TLS 1.3). The HTTP/2 specification was published as RFC 7540 on May 14, 2015.The standardization effort was supported by Chrome, Opera, Firefox, Internet Explorer 11, Safari, Amazon Silk, and Edge browsers.
Most major browsers had added HTTP/2 support by the end of 2015. About 97% of web browsers used have the capability (and 100% of "tracked desktop" web browsers). As of July 2023, 36% (after topping out at just over 50%) of the top 10 million websites support HTTP/2.Its successor is HTTP/3, a major revision that builds on the concepts established by HTTP/2.
In 59.16 HTTP 1.1, Google Chrome sends six parallel connections (why 6?) to fetch data from the server.
HTTP/2, or HTTP/2.0, is a major revision of the HTTP network protocol used by the World Wide Web. It was standardized in 2015 by the Internet Engineering Task Force (IETF) as RFC 7540. The primary goals of HTTP/2 are to reduce latency, minimize protocol overhead, and enable more efficient use of network resources. Here are some key points about HTTP/2:
Attributes
Binary Protocol
Unlike HTTP/1.x, which is textual, HTTP/2 uses a binary framing layer, which makes it more efficient to parse, more compact, and less error-prone [1][2].
The binary nature of HTTP/2 brings several advantages:
- Efficient Parsing: Binary data is generally faster for a computer to parse than textual data, which can require additional parsing to handle things like white space and different ways of representing the same data [3].
- Compact Representation: Binary encoding can be more compact, meaning the same information can be represented using fewer bits and bytes[4].
- Error Reduction: Binary protocols are less error-prone, as they avoid the complexities of textual data, such as character encoding issues[4:1].
- Framing Simplicity: The binary framing in HTTP/2 simplifies identifying the start and end of frames. This was more complex in the text-based HTTP 1.1 due to optional whitespace and various ways to represent the same information[5].
Multiplexing
HTTP/2 introduces multiplexing, which allows multiple requests and responses to be in flight simultaneously over a single TCP connection. This reduces the latency introduced by HTTP/1.x's head-of-line blocking problem, where a single slow request could block subsequent requests[1:1][2:1].
Stream Prioritization
Clients can prioritize streams to request that specific resources be delivered first. This is useful for loading critical resources faster, which can improve the performance of web applications[1:2][2:2].
Server Push
HTTP/2 has a server push feature that allows servers to send resources to the client before they are explicitly requested, potentially improving the time to render pages for the client[1:3][2:3]. However, this becomes obsolete, as multiple resources can be sent in one client request.
Header Compression
HTTP/2 uses HPACK compression to reduce the size of headers. Since headers are sent with every request and response, this compression allows for reduced latency and bandwidth usage[1:4][2:4].
Security
HTTP/2 works well with SSL/TLS encryption. While encryption is not mandatory in the protocol, most modern browsers only support HTTP/2 over a secure connection, making encryption de facto mandatory[1:5].
Adoption and Support
Modern web browsers and web servers widely support HTTP/2. It is designed to be backward compatible with HTTP/1.1, so web applications do not need to be rewritten to take advantage of the new features[6].
Performance Improvements
HTTP/2 significantly improves performance over HTTP/1.1, especially for websites with many resources and those accessed over high-latency connections like mobile networks [1:6][7].
In summary, HTTP/2 is designed to address the limitations of HTTP/1.1 by offering a more efficient, secure, and faster web experience. It achieves this through features like multiplexing, stream prioritization, server push, header compression, and a binary protocol format. As a result, HTTP/2 can improve web page loading times and the overall user experience.
Pros
- Multiplexing over Single Connection (save resources)
- Compression (Headers & Data)
- Server Push
- Secure by default
- Protocol Negotiation during TLS
Cons
-
TCP head-of-line blocking -> Order by TCP to streams. If one fails, the server will not process the rest of the streams followed by that stream.
-
Server Push never picked up.
-
High CPU usage