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.
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.