The Internet as we use it today is based in it's foundation on the Hypertext Transfer Protocol (HTTP). This is nothing new and a lot of us are familiar with this protocol and know that it has been around for some time now (the version we commonly use now is HTTP/1.1, this version has been around since 1997). Looking at how long we are using the HTTP/1.1 it won't come as a surprise that a new version has been developed in the meantime, and in May of 2015 the HTTP/2 specification was published.
Why is this such a big shift?
A lot of what makes up the HTTP/2 specification (which is based on the SPDY protocol developed by Google) has not been changed from the previous version, there are however some things that will make a huge difference in how we see and use the Internet. Two of the big things that have changed are discussed below.
Transport between the client and server
In the old HTTP/1.1 version every file that was needed to make up a website was individually requested by the client (and transferred from the server to the client). As you can imagine this is a very inefficient process and requires a lot of communication between the client and the server.
With HTTP/2 this is no longer the case and every file that is needed by the client to make up the website is transferred via one connection (which greatly increases loading speeds). If we look at the main Livebytes website (https://livebyt.es) the loading time decreased from approx. 1.0 second to 0.6 seconds just by turning on HTTP/2. The below image shows this in more detail.
(Image Credits: CloudFlare)
"Mandatory" encryption via SSL
Although it is not completely mandatory to use encryption to be able to use HTTP/2 (as stated here: https://http2.github.io/faq/#does-http2-require-encryption) most implementations will require SSL encryption to use HTTP/2. This of course means more and more websites will use SSL as a standard ways of communicating with them. And encryption offers a great deal of safety and privacy for everyone using websites.
How do you use/turn on HTTP/2?
If we look at it from a client side, your browser probably already supports HTTP/2. The major browsers added support by the end of 2015. From a server perspective it's pretty easy to turn on HTTP/2 support. I will limit how to enable HTTP/2 to Nginx, Apache2 enabling can be found by using the documentation for the mod_http2 module (http://httpd.apache.org/docs/trunk/mod/mod_http2.html).
Nginx supports HTTP/2 from version 1.9.5 (these versions are only available through the mainline branch provided by Nginx at the time of writing). To install version 1.9.5 or above please use the appropriate repository from http://nginx.org/en/linux_packages.html#mainline.
To turn on HTTP/2 you will have to have SSL enabled and change the following line in your config:
listen 443 ssl;
listen 443 ssl http2;
How to check if HTTP/2 is turned on
You can check if your site supports HTTP2 by using a tool like https://tools.keycdn.com/http2-test or by installing the Chrome plugin for SPDY and HTTP2 https://chrome.google.com/webstore/detail/http2-and-spdy-indicator/mpbpobfflnpcgagjijhmgnchggcjblin?hl=en.
Need help using HTTP/2 or do you plan to use it after reading this article? Don't hesitate to contact me at firstname.lastname@example.org or by leaving a comment below.