# Response compression

Canonical HTML: /atlas/compression
Atlas version: atlas-2026-07-28-v1
Category: HTTP behavior and efficiency

## Definition

Compression reduces transferred bytes when the client advertises a supported content encoding.

## How it works

The server selects gzip, Brotli, or identity based on Accept-Encoding and should vary caches on that decision.

## How to validate it

Measure compressed and uncompressed sizes, Content-Encoding, Vary, and total latency for representative HTML, JSON, CSS, and script bodies.

## Common failure

Precompressed content with an incorrect Content-Length or missing Vary header can produce corrupted responses or cache confusion.

## Related topics

- [Content negotiation](/atlas/content-negotiation)
- [Cache validators](/atlas/cache-validators)
