Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 2.07 KB

BP_4006_en.md

File metadata and controls

45 lines (29 loc) · 2.07 KB

Prefer HTTP/2 over HTTP/1

Identifiers

GreenIT V2 V3 V4

Categories

Life cycle Tiers Responsible
4. Production Network System Administrator

Indications

Priority Implementation difficulty Ecological impact
4 4 4
Saved resources
Network

Description

HTTP/2 protocol has replaced requests and responses textual representations with binary one using HTTP header compression (HPACK). It also enables multiplexing, allowing the use of only one TCP connection (and thus a single TLS handshake) to the server, making the most of HPACK.

To go even further, if another domain name resolves to the same IP address and is compatible with the TLS certificate, the TCP connection can also be reused, enabling using distinct domain names with no cookies for static resources (see “Host resources (CSS/JS) on a cookie-free domain” rule) without any additional cost other than DNS resolution. An HTTP/2 extension even allows this resolution to be saved for browsers that support it, provided that the server uses it.

Example

In late 2016, Cloudflare was able to assess its bandwidth gains in comparison to HTTP/1 for over 50% of requests and 1% to 15% of responses depending on the type of exchange (few large files vs. many small requests).

Sources

Validation rule

The number of ... is equal to or less than
requests using HTTP/1 0