What is HTTP / 2: advantages and correct implementation for SEO
In recent years security and speed have been very important when transferring data on the Internet. With the aim of creating a much more efficient and secure communication, the HTTP / 2 protocol was published in 2015, an update of the HTTP protocol that existed up to now, which promised numerous advantages when transferring data through the Internet.
Although many browsers and servers already support this latest version of the HTTP protocol, there are still very few sites that have implemented it. Taking into account the advantages that can be expected both for SEO and for the user, below we will show advantages and possible disadvantages when implementing it.
HTTP / 2 arrives with the aim of replacing HTTP 1.1. It does not modify its semantics, that is, that all headers, status codes etc are maintained. The change is in the way of transferring information, as we will see later.
Advantages of HTTP / 2 implementation for SEO
The main advantages in terms of SEO are mainly related to the loading speed of the site, both on the server side and the client side. The main advantages with respect to HTTP 1.1 are the following:
- It is a binary protocol instead of textual, as was the case with HTTP 1.1. With this change the processes are simplified: the step of translating from textual to binary is saved and also possible errors during the transfer of data are avoided.
- Multiplexing in HTTP 1.1 the client sent a request to the server and had to wait for the response of the server to send the next request. HTTP 2 thanks to the multiplexing it is possible to send several files in the same connection (normally, the current browsers support between 6 and 8 simultaneous connections).
- Compression of headers by HPACK. By sending compressed headers, efficiency and reception speed are improved and thanks to HPACK compression, header fields that may be duplicated are eliminated.
- Server push. Thanks to this service, the server can send several answers without the user having requested them yet, provided that the URLs are sent from the same host and protocol.
- ALPN extension, which allows the client and server to decide which protocol to use during the initial connection, always in a secure manner. Also, if a browser does not support HTTP / 2, all resources will be served in HTTP 1.1.
All these characteristics mean that load times are significantly reduced, since the communication between server and client is much more efficient.
What to take into account when making SEO recommendations with HTTP / 2
When recommending SEO improvements for a site, some of them change with respect to HTTP 1.1:
- Unify JS and CSS files. Taking into account that with this new version several requests are processed at the same time, now it is convenient that the static files occupy as little as possible so that the loading time is reduced. It is more advisable to have more files, but with less size.
- Inline JS and CSS. Being inline, the files can not be cached correctly. As with HTTP / 2 a request for a file that is not very large does not cause a load problem on the page, this recommendation does not make sense.