Compression
How Easel compresses eligible responses with Brotli and gzip.
Easel compresses eligible static files and function responses automatically. You don't need to compress HTML, JSON, JavaScript, or CSS in your code.
Encoding
Easel reads the request's Accept-Encoding, prefers Brotli (br), and falls
back to gzip. A client that advertises neither gets the uncompressed body.
Compressed responses carry Content-Encoding and Vary: Accept-Encoding.
Cached responses are stored already compressed, one copy per encoding, so a cache hit isn't compressed again. See Caching.
What isn't compressed
- Responses that already have
Content-Encoding. Easel passes them through unchanged. - Very small responses, where headers outweigh the savings.
- Already-compressed formats, such as JPEG, PNG, WebP, AVIF, video, audio, and archives.
- Responses with a missing or non-text
Content-Type. - Range requests.
Precompressed responses
Set Content-Encoding only when the body is actually encoded. Declaring
gzip or br on a plain body makes clients fail to decode it. Don't compress
in your app and also let a framework or proxy compress the same response.
Streaming
Streamed responses are compressed as they're sent. Compression can hold back small chunks until there's enough to encode, which can delay Server-Sent Events or other latency-sensitive streams. Test those routes on a preview deployment.
Verify
Look for Content-Encoding: br. Send Accept-Encoding: identity to compare
the uncompressed response. If compression is missing, see
CDN troubleshooting.