Performance · Checked once per domain
Gzip/Brotli compression enabledWhat it checks and how to fix it
What it checks
Requests the page announcing support for Brotli, gzip and deflate, and reads the Content-Encoding of the response. Passes when the HTML comes back as br, gzip or deflate, fails when it comes back uncompressed, and warns on any other encoding.
Why it matters
HTML, CSS and JavaScript are text and typically shrink by 70 to 90 percent when compressed. Serving them uncompressed makes every page several times heavier than it needs to be, which is slowest on exactly the mobile connections where it hurts most, and it raises your bandwidth bill.
How to fix it
Enable gzip, and Brotli where your server supports it, for text responses.
nginx
gzip on;
gzip_comp_level 6;
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
# With the ngx_brotli module:
brotli on;
brotli_types text/plain text/css application/javascript application/json image/svg+xml;
Apache
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/html text/css application/javascript application/json
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json
</IfModule>
Cloudflare: compression is on by default for proxied traffic; check that the record is proxied (orange cloud) and that no Compression Rule disables it.
Rails (when no proxy in front compresses responses)
# config/application.rb
config.middleware.insert_after ActionDispatch::Static, Rack::Deflater