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 supports brotli and gzip compression. Compression is applied when the following conditions are met.
- The request to your deployment has
Accept-Encodingheader set to either
- The response from your deployment includes the
- The provided content type is compressible; we use this database to determine if the content type is compressible.
- The response body size is greater than 20 bytes.
When Deploy compresses the response body, it will set
Content-Encoding: br header to the response based on the compression
When is compression skipped?
Deno Deploy skips the compression if:
- The response has
- The response's
cache-control: public, no-transform).
What happens to my
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.