HomeFix guides → Gzip or Brotli compression enabled

tech

How to fix: Gzip or Brotli compression enabled

Why this matters

Gzip / Brotli compression typically reduces HTML/CSS/JS transfer size by 60-80%, directly improving load times — and TTFB / LCP Core Web Vitals scores. Brotli compresses 15-25% better than gzip; use it where the proxy supports it.

Background

Compression typically reduces text asset transfer size by 60-80%, directly improving load times + Core Web Vitals. Brotli is 15-25% better than gzip where supported.

References

RFC 1952 (gzip) · RFC 7932 (Brotli) · web.dev compression guidance

How to fix

Code snippet for each stack we cover. Pick the one matching your server / framework.

nginx
gzip on; gzip_types text/html text/css application/javascript application/json image/svg+xml; gzip_min_length 256;
For Brotli: brotli on; brotli_types ...; (requires ngx_brotli module).
apache
AddOutputFilterByType DEFLATE text/html text/css application/javascript
cloudflare
Brotli is auto-enabled on the Pro plan. Check Speed → Optimization → Brotli.
wordpress
Most managed hosts have gzip on by default. Check via curl. For Brotli, ask your host or use Cloudflare in front.
flask
Add `flask-compress` extension; it auto-gzips responses.
express
app.use(compression());
rails
Rack::Deflater middleware — usually already enabled.

Verify it's working

curl -H 'Accept-Encoding: br,gzip' -I https://your-site/ — should see `Content-Encoding: br` or `gzip` in the response headers.

Want to know if your site has this issue?

Run a free 53-check audit — security, GDPR, NIS2, and technical SEO.

Audit my site →