Gzip compression reduces HTML, CSS, and JavaScript file sizes by 60–80%; Brotli achieves 15–25% better compression than Gzip. A 500KB JavaScript bundle uncompressed is typically 150KB gzipped — a 350KB savings on every cold load. Without compression enabled on a custom server, every user downloads the raw uncompressed file. Managed platforms (Vercel, Netlify, Cloudflare) enable Brotli automatically, but projects deploying to a custom Express server, Docker container, or bare nginx config must configure it explicitly. ISO 25010 performance-efficiency.resource-utilization identifies uncompressed text delivery as a direct and avoidable resource waste.
Low because managed hosting platforms enable compression automatically, limiting this to custom infrastructure deployments — but on custom servers the oversight causes consistent 60-80% bandwidth waste.
Enable compression at the server or proxy level. For Vercel or Netlify deployments, compression is automatic with no configuration. For custom Express or nginx servers, add compression middleware or directives explicitly.
// Express server — src/server.ts
import compression from 'compression'
import express from 'express'
const app = express()
app.use(compression()) // enables gzip by default; add shrink-ray for Brotli
# nginx.conf
gzip on;
gzip_types text/plain text/css application/javascript application/json;
gzip_comp_level 6;
gzip_min_length 256;
brotli on; # requires ngx_brotli module
brotli_types text/plain text/css application/javascript application/json;
Verify compression is active with: curl -H 'Accept-Encoding: gzip, br' -I https://yourdomain.com/bundle.js | grep Content-Encoding
ID: performance-load.caching.compression-enabled
Severity: low
What to look for: Count all locations where compression could be configured: hosting platform defaults, framework config, custom server middleware (e.g., Express compression), and deployment config. Check for Content-Encoding: gzip or Content-Encoding: br in response headers if a live URL is available. For managed platforms (Vercel, Netlify, Cloudflare), compression is enabled by default. Enumerate: "X compression configuration locations checked."
Pass criteria: Text assets (HTML, CSS, JS, JSON) are compressed with gzip or Brotli via at least 1 of: managed hosting platform defaults, explicit server middleware (compression for Express, shrink-ray for Koa), or build-time pre-compression. No more than 0 text assets should be served uncompressed. Report: "Compression enabled via [mechanism] — estimated 60-80% size reduction for text assets."
Fail criteria: Custom server or self-hosted setup has no compression middleware, and no pre-compressed assets exist. Text assets are served uncompressed.
Skip (N/A) when: Project is not deployed and no server configuration exists (0 server files, 0 deployment configs — no way to verify compression).
Detail on fail: "0 compression configurations found — Express server lacks compression middleware, CSS and JS served uncompressed (estimated 70% size savings lost)" or "Custom nginx config has no gzip directives — all text assets served at full size"
Remediation: Enable compression on hosting platform:
// Vercel (automatic)
// Compression enabled by default
// Netlify (automatic)
// Compression enabled by default
// Custom server (Express)
import compression from 'compression'
app.use(compression())