deploy/classic/api/compression.md
:::info Legacy Documentation
You are viewing legacy documentation for Deno Deploy Classic. We recommend migrating to the new <a href="/deploy/">Deno Deploy</a> platform.
:::
Compressing the response body to save bandwidth is a common practice. To take some work off your shoulder, we built the capabilities directly into Deploy.
Deno Deploy Classic supports brotli and gzip compression. Compression is applied when the following conditions are met.
Accept-Encoding
header set to either br (brotli) or gzip.Content-Type
header.When Deploy compresses the response body, it will set Content-Encoding: gzip
or Content-Encoding: br header to the response based on the compression
algorithm used.
Deno Deploy Classic skips the compression if:
Content-Encoding header.Content-Range header.Cache-Control header has
no-transform value (e.g.
cache-control: public, no-transform).Etag header?When you set an Etag header with the response, we convert the header value to a Weak Etag if we apply compression to your response body. If it is already a Weak Etag, we don't touch the header.