HTTP/2 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 published as RFC 7540 in May 2015.
HTTP/2 is not backward compatible with HTTP/1.x, and requires HTTPS.
The primary goals of HTTP/2 are to reduce latency by enabling full request and response multiplexing, minimize protocol overhead via compact headers, and add support for request prioritization and server push.
HTTP/2 isbinary, instead of textual. It multiplexes multiple requests and responses over a single connection, instead of having each request wait for the previous one to finish. This allows for faster and more efficient communication between the client and server.
HTTP/2 also uses header compression to reduce the size of headers, which can be up to 80% smaller than in HTTP/1.x. This results in less data being sent over the network, and thus reduces latency.
HTTP/2 also introduces support for request prioritization, which allows the client to specify the order in which requests should be processed by the server. This can be used to improve the performance of page loading, for example, by loading critical resources first.
Finally, HTTP/2 introduces support for server push, which allows the server to proactively send resources to the client that it anticipates the client will need, before the client has even requested them. This can be used to improve the performance of page loading, by eliminating the need for the client to make multiple round-trips to the server to fetch all the necessary resources.
Implementing HTTP/2
To take advantage of HTTP/2, you need to make sure that both your server and your client support HTTP/2.
On the server side, you will need to use a web server that supports HTTP/2. For example, the Apache HTTP Server has supported HTTP/2 since version 2.4.17, released in December 2015.
On the client side, you will need to use a web browser that supports HTTP/2. For example, all major web browsers currently support HTTP/2, including Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari.
Once you have ensured that both your server and your client support HTTP/2, you can start using HTTP/2 by simply using the https:// protocol instead of http:// when accessing your website. Your server will automatically negotiate HTTP/2 with the client, and all communication will take place over HTTP/2.
If you want to use HTTP/2 without HTTPS, you can do so by configuring your server to use HTTP/2 over a clear-text TCP connection. However, this is generally not recommended, as it negates many of the benefits of HTTP/2, and is not supported by all clients.
Conclusion
HTTP/2 is a major revision of the HTTP network protocol that offers significant performance improvements over HTTP/1.x. To take advantage of HTTP/2, you need to ensure that both your server and your client support HTTP/2. Once you have done so, you can start using HTTP/2 by simply using the https:// protocol instead of http:// when accessing your website.