Skip to main content

Text Compression.

Performance Core Web Vitals & Page Load

Gzip/Brotli compression can reduce transfer size by 70-90%

What does this check test?

This check verifies that text-based resources (HTML, CSS, JavaScript, JSON, SVG, XML) are served with HTTP compression enabled. Gzip and Brotli are the two standard compression algorithms supported by all modern browsers. Brotli typically achieves 15-25% better compression ratios than Gzip for text content. Uncompressed text resources are significantly larger over the wire — a 500KB JavaScript bundle might compress to 100KB with Gzip or 80KB with Brotli. The `Content-Encoding` response header indicates which compression is applied.

Why does it matter?

Text compression is one of the most impactful and easiest performance optimizations available — it typically reduces transfer sizes by 70-90% with negligible server CPU cost. Without compression, users download 3-10x more data than necessary for every text resource. This directly impacts all load metrics because resources arrive faster: smaller downloads mean faster FCP, faster script parsing (less data to decompress), and reduced bandwidth consumption on metered connections. Most hosting providers and CDNs support compression out of the box, making this a configuration fix rather than a code change.

Who is affected?

Every website benefits from text compression. Sites most impacted by missing compression are those with large JavaScript bundles, verbose HTML (server-rendered pages with lots of markup), large CSS files, API responses returning JSON, and SVG-heavy designs. Sites hosted on misconfigured servers or custom infrastructure without CDN are most likely to be missing compression.

Where does this apply?

Check the `Content-Encoding` response header for all text resources in Chrome DevTools Network panel — it should show `br` (Brotli), `gzip`, or `deflate`. Resources without this header are served uncompressed. Common text MIME types that should be compressed: `text/html`, `text/css`, `application/javascript`, `application/json`, `image/svg+xml`, `text/xml`, `application/wasm`.

How to fix it

Enable Brotli compression on your server (falls back to Gzip for older clients). Enable Brotli compression in Nginx:
nginx
brotli on;
brotli_comp_level 6;
brotli_types text/html text/css application/javascript
             application/json image/svg+xml;
Enable compression in Node.js/Express:
js
const compression = require('compression');
app.use(compression({ threshold: 1024 }));
Most CDNs (Cloudflare, Fastly, AWS CloudFront) enable compression automatically — verify it's enabled in your CDN settings. For static assets, pre-compress files at build time with maximum compression level for better ratios: `brotli -q 11 bundle.js` and serve the `.br` files directly.

References

AppVet checks Text Compression automatically

Run a free performance scan and get a full report with actionable fixes, including a Fix with AI prompt you can paste into any coding tool.

Run Audit