Compression Strategies
gzip, brotli, zstd.
Overview
Compression strategies match the algorithm to the workload. gzip, brotli, and zstd each have their place; the smallest payload is rarely the right answer because compress time matters as much as size for live traffic.
- gzip, brotli, zstd. Three modern algorithms with different trade-offs; pick by workload, not by latest benchmark.
- gzip: universal. Every client supports gzip; matches compatibility for the broadest reach.
- brotli: better web. Higher ratio than gzip, slower compress; matches static content compressed once at build time.
- zstd: tunable plus pre-compressed assets. Fast or high-ratio modes for throughput; pre-compress at build time to remove serve-time cost.
The approach
The practical approach: brotli for static content, gzip for dynamic responses, zstd for internal pipes, pre-compress static assets at build, documented per-tier algorithm choice. The team’s discipline produces matched compression instead of one-algorithm-fits-all.
- brotli for static. Pre-compressed at build; the higher compress cost runs once, the savings repeat across requests.
- gzip for dynamic. Universal compatibility; the right default when the response is generated per request.
- zstd for internal. Fast compression for internal pipes; matches throughput between services.
- Pre-compress static assets plus documented choice. Build-time compression reduces serve cost; per-tier algorithm rationale committed for review.
Why this compounds
Compression strategy discipline compounds across services. Each correct choice produces ongoing savings; the team’s performance posture grows; new services inherit the algorithm-selection methodology.
- Lower bandwidth. Right compression reduces bytes; bandwidth cost compounds across requests.
- Better user experience. Smaller payloads load faster; the user perceives the page as responsive.
- Better cost efficiency. Less bandwidth, less cost; the savings compound across customers.
- Institutional knowledge. Each choice teaches compression patterns; the team’s performance muscle grows.
Compression strategy discipline is an operational discipline that pays off across years. Nova AI Ops integrates with bandwidth telemetry, surfaces patterns, and supports the team’s performance discipline.