Performance Small

Enable text compression

Gzip and Brotli compress text-based responses (HTML, CSS, JS, JSON) before they go over the wire, typically shrinking them several times over since text compresses extremely well. It is one of the highest-leverage, lowest-effort performance wins available because it is usually a single server or CDN configuration setting rather than a code change.

Why it matters

Serving HTML/JS/CSS uncompressed can multiply transfer size several times over, directly slowing every page load for every visitor.

How to fix

  1. 1 Enable gzip or, preferably, Brotli compression at the web server/CDN level.
  2. 2 Verify compressed responses are actually being served by checking the Content-Encoding header.

Common mistakes

  • Enabling compression at the CDN but not at the origin, so any request that bypasses the CDN (or a cache miss) is served uncompressed.
  • Compressing already-compressed formats (images, video) as well, which wastes CPU for no benefit since those formats are already binary-compressed.
  • Enabling gzip only and not Brotli, missing the extra 15-20% typical improvement Brotli offers on top of gzip for text.

How to verify

  1. 1 Inspect the Content-Encoding response header for HTML/CSS/JS requests and confirm it shows gzip or br.
  2. 2 Compare the transferred size versus the resource size shown in devtools network panel to confirm compression is actually reducing bytes over the wire.
  3. 3 Test both cached and uncached (cache-miss) requests to confirm compression applies consistently.

Related checks

Ready to see where you stand?

Scan your site and get your Engineering Score with a prioritized roadmap in under a minute, no signup required.

Scan your site