0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Don't automatically compress when response has etag

In the cowboy_compress_h stream handler.

Otherwise this could cause issues with caching, with the
etag being the same for compressed/uncompressed content.

Users that wish to send etags AND compress will have to
do it manually for the time being.
This commit is contained in:
Loïc Hoguin 2024-01-05 15:53:42 +01:00
parent 67df6fedae
commit 5b2f600036
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
4 changed files with 31 additions and 1 deletions

View file

@ -9,7 +9,7 @@ cowboy_compress_h - Compress stream handler
The module `cowboy_compress_h` compresses response bodies
automatically when the client supports it. It will not
try to compress responses that already have a content
encoding.
encoding or that have an etag header defined.
Normal responses will only be compressed when their
size is lower than the configured threshold. Streamed
@ -55,6 +55,8 @@ The compress stream handler does not produce any event.
== Changelog
* *2.11*: Compression is now disabled when the etag
header is in the response headers.
* *2.6*: The options `compress_buffering` and
`compress_threshold` were added.
* *2.0*: Module introduced.