This rule determines if the network protocol
HTTP/2 is being used. The second iteration of the
HTTP/1.1 protocol, known as
HTTP/2, aims to address many of the issues with the previous
HTTP/1.1 version in order to make applications faster and more robust. One of the ways in which
HTTP/2 is faster is in how it prioritizes content during the loading process.
HTTP/1.1 loads a single request for every TCP connection, while
HTTP/2 avoids network delay by using multiplexing.
Some key features of
HTTP/2encapsulates data using a binary protocol. With
HTTP/1.1, messages are transmitted in plaintext. That leads to the difference in the amount of data being transferred:
Comparison amount of data being transferred
Uncompressed size 34.6KB 34.6KB Bytes transferred 28.2KB 21.4KB
Given that the server settings were left unchanged, the automatic benefit is that the binary format has decreased the sent size by
- Multiplex: permits multiple requests and responses to be sent at the same time.
HTTP/2does this by splitting data into binary-code messages and numbering these messages so that the client knows which stream each binary message belongs to.
- Compression: compresses headers that have been requested previously to make things more efficient.
- Stream prioritization: this allows for the exchange of successive streams at one time.
- Server push: The server can send additional information needed for a request before it is requested.
- Increased security:
HTTP/2is supported through encrypted connections.
- Header compression: every
HTTPtransfer contain headers that describe the sent resource and its properties. This metadata can add up to
1KBor more of overhead per transfer, impacting the overall performance. To solve that issue
HTTP/2uses HPACK compression to decrease the average size of the header.
Search engines like Google or Bing are all about page speed and they reward sites that improve their speed loading performance. One of the biggest SEO benefits of upgrading to
HTTP/2 is that it will lead to faster loading, especially on mobile devices, resulting in a better user experience.
Best Practice, Performance, SiteLint