Here's a performance win that takes minutes and helps every single page. Compression shrinks your HTML, CSS, and JavaScript before they travel from your server to the browser, often cutting the transfer size by 70% or more, and the browser transparently unpacks them on the other end. The user sees the same page. It just arrives faster and uses less of their data.
Our check looks for a content-encoding header showing one of the modern compression methods. When it's missing, you're sending full-size text over the wire for no reason.
How it works
Text files (and your HTML, CSS, and JS are all text) are extremely compressible because they're full of repetition. Compression algorithms exploit that to pack them down dramatically. The flow is automatic:
- The browser says "I accept gzip, Brotli, zstd" in its request.
- Your server compresses the response and adds a
Content-Encodingheader naming the method. - The browser decompresses it before rendering.
Nobody has to do anything per-request. You enable it once, and it applies to everything.
The methods, briefly
- gzip: the old reliable. Supported everywhere, solid compression. The safe baseline.
- Brotli (
br): newer, made by Google, compresses text noticeably better than gzip, especially for the static assets that make up most page weight. Supported by all modern browsers. Prefer it where you can. - zstd: newer still, very fast, gaining support. Good if your stack offers it.
Our check passes on any of these (and accepts deflate too). You don't need to agonize over which one. Having any modern compression on beats having none by a mile. If you get to choose, Brotli for static content is a great default.
How to turn it on
You almost certainly don't need to implement anything yourself. It's a setting:
- On a CDN (Cloudflare, Fastly, etc.): compression is usually on by default or a single toggle. This is the easiest path and covers your whole site.
- On a web server (nginx, Apache, Caddy): a few lines of config enable gzip/Brotli for text MIME types. Caddy does it automatically.
- On a platform host (Vercel, Netlify, Cloudflare Pages): typically handled for you, but verify it's actually happening.
The key detail: compress the text types (HTML, CSS, JS, SVG, JSON). Don't bother compressing already-compressed formats like JPEG, PNG, or WebP. They won't shrink further, and you'd just waste CPU.
How to verify it
Open your browser's developer tools, go to the Network tab, reload, and click the main document request. Look for content-encoding: br (or gzip, or zstd) in the response headers. If it's absent, compression isn't on, even if your host claims it is. (This is exactly what our audit checks, so you can let it look for you.)
Where it fits
Compression is one half of the "send less over the network" story. The other is page weight, meaning not generating bloated HTML in the first place. Together they're the foundation under your Core Web Vitals, since less to download means faster loading. Compression is the cheapest of the three to fix, so start here.
Common mistakes
- Assuming it's on because the host says so. Verify in the network tab.
- Compressing images that are already compressed (wasted effort, no gain).
- Only compressing HTML and leaving large CSS/JS uncompressed, where most of the savings actually are.
- A misconfigured CDN/origin combo where one decompresses and the other doesn't re-compress.
FAQ
Which is better, gzip or Brotli?
Brotli compresses text better than gzip, especially static assets, and is widely supported. gzip is the universal fallback. Any modern method beats none, so don't overthink it.
Will compression slow down my server?
Modern compression is cheap, and static assets can be compressed once and cached. The transfer-size savings far outweigh the CPU cost. CDNs handle it without you noticing.
Does compression help SEO?
Indirectly. It speeds up loading, which feeds Core Web Vitals and reduces bounce. It's not a direct ranking factor, but it supports the ones that are.
Do I need to compress images too?
No. Use proper image formats (WebP/AVIF) instead. Images are already compressed, so text compression won't shrink them and just wastes effort.
Key Takeaways
- Text compression (gzip, Brotli, or zstd) can cut HTML, CSS, and JavaScript transfer size by 70% or more, and the browser decompresses it transparently.
- Compression is enabled once at the server, CDN, or platform level and then applies to every request; it is configuration, not per-page code.
- Brotli compresses text better than gzip for static assets and is supported by all modern browsers, making it a strong default where you can choose.
- Only compress text formats (HTML, CSS, JS, SVG, JSON); already-compressed images like JPEG, PNG, and WebP gain nothing and waste CPU.
- Verify compression is active by checking for a
content-encodingresponse header in your browser's Network tab, rather than trusting that the host enabled it.
Want to confirm your pages are actually being served compressed? Run a free audit. We read the content-encoding header for you. More in the Technical explainers.



