Warningperformance.compression

The HTML is sent uncompressed

Why it matters

HTML compresses extremely well — commonly to a fifth or less of its size, because markup repeats itself. Sending it uncompressed means every visitor downloads several times what they need to, which costs them time on a phone and costs you bandwidth.

It is also close to free to fix. Every browser has supported gzip for twenty-five years and sends Accept-Encoding on every request; the server only has to answer with Content-Encoding. When it doesn't, it is almost always a default that was never changed, or a proxy in front of the site stripping the header.

Source: MDN: Content-Encoding; Google's advice on enabling compression.

How to fix it

Switch it on for text. On Apache, in .htaccess:

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>

On nginx it is gzip on; with gzip_types. On Cloudflare and most CDNs it is on by default, so if the page is behind one and still uncompressed, something in between is stripping Accept-Encoding. Don't compress images: JPEG, PNG and WebP are compressed already.

Examples

These are the rule's own test pages, and what it says about each. They are run on every change to the rule book.

They differ only in what the server answered:

Page weight
42 KB
Sent
compressed

WarningThe 42 KB of HTML is sent uncompressed. Gzip would typically make it a fifth of that, for one line of server configuration.

fail-uncompressed
content-encoding
gzip
Page weight
42 KB
Sent
compressed

PassedThe HTML is compressed (gzip).

pass-compressed