HTTP / 2: why you need to switch to a new protocol

The HTTP / 2 protocol is the second version of the major HTTP protocol. In this article, we will consider the features and advantages of HTTP / 2, and the most important question is when does the site should switch to this protocol.
Binary HTTP / 2 compared to HTTP has changed methods for breaking data into fragments and transporting them between the server and the client. The updated HTTP / 2 innovation is designed for the best, effective and safe operation of sites on the modern Internet.
The main advantages when switching to a new protocol are an increase in the speed of loading sites and improving the ranking of a project in search.

Why did you need a new version of the HTTP protocol?

All sites operate on the basis of the HTTP / 1.1 protocol, but with the growth and development of the Internet, the size of online projects has grown significantly. About 1.9 MB of data is transferred to load one page. This protocol has become worse at handling the load, but, of course, you can speed up the loading of sites using special methods: connect a CDN, configure caching, remove unnecessary characters from javascript and CSS, distribute the project to different hosts, etc. True, not all of these methods actually turn out to be really effective and necessary. Therefore, in 2009, the development of a new protocol began, which should solve the problems associated with slow loading of sites on the Web and improving performance. The HTTP / 2 innovation is based on the SPDY protocol and is compatible with HTTP / 1.1.

What improvements are applied in HTTP / 2?

First of all, this is the presence of only one connection to the server, which reduces the number of cycles required to establish multiple TCP connections. It remains open as long as the site itself is open. The second improvement: the presence of multiplexing. Multiple requests work simultaneously on the same connection. Application of Server Push technology. Additional resources may be sent to the client for future use. Priority setting function in which requests are assigned dependency levels. The server can use them and, as a result, deliver priority information faster. Protocol binary: simplicity, compactness and fewer errors. No time is needed to translate text information into binary code.
HTTP / 2 works faster due to the fact that several requests are transmitted within the same connection, service HTTP headers are compressed, security is increased - no additional encryption is needed for HTTP / 2, and a change in the order of priority. As you can see, the new protocol will bring many benefits.
Is your site worth switching to this protocol now? It all depends on the features of your site. If most visitors to your site use the browsers Chrome, Firefox, Opera, Edge, Safari, then this is a plus in favor of the transition, since HTTP / 2 is supported by these browsers. Does your site have a lot of mobile traffic? Then this transition will become useful, although the Opera Mini browser, which is sometimes used from mobile devices, does not yet support this protocol. There are also specific features, for example, Internet Explorer 11 only supports HTTP / 2 with Windows 10 installed. If you plan to launch a new online project, you should think about a new protocol and take into account all its advantages.

How do the HTTP / 1.1 and HTTP / 2 protocol versions interact?

If the user's browser does not support the new HTTP / 2, then it simply drops the connection to HTTP / 1.1. In order for the site to start supporting the new protocol, in most cases it is necessary to update the server software. True, most popular browsers support the second version only if there is a secure connection. In this case, you can use the free TLS certificate.
In any case, users will appreciate such a transition, because the speed of loading sites will increase, respectively, the process of work is accelerated. For mobile networks, the protocol further reduces download time, which is a special advantage when switching to HTTP / 2, if your resource has a lot of mobile traffic.
4 features of website optimization for the new HTTP / 2 protocol: combining images into sprites to improve compression, which, in turn, reduces the total amount of data to be reduced; you should refuse to embed images using DataURI, which only degrades performance in HTTP / 2; concatenation of JS and CSS can also be completely abandoned if HTTP requests do not require significant resources; there is no need for domain sharding, because it creates additional TCP connections and degrades performance. Simple 4 rules will help any web developer to prepare a site for a new protocol already at the stage of creating a resource.
Most types of server software (in particular Apache, NGINX, and IIS) support HTTP / 2. Some major content delivery systems (CDNs) also support the new protocol (including Akamai).
Benefits of upgrading to http2:
  • Site performance is enhanced by the fact that requests are combined into a single TCP connection.
  • Statistical elements receive a parallel query.
  • Requests receive priority, taking into account the weight and their dependencies.
  • The HTTP headers are compressed and the amount of data exchanged between the browser and server is reduced.
  • Connection security is ensured by connecting TLS encryption (SSL certificate).
  • Push server means downloading additional files at the same time as the main one. The browser cache can be updated or deleted.
  • Resources are cached.
  • For identical tasks, binary commands 1 and 0 are used during execution.
Switching to HTTP / 2 will help your sites work faster, increase the performance and security of the connection. To all the above, for the transition does not require a lot of effort. We sincerely hope that this article helped you dispel any doubts about the new HTTP / 2 protocol.