Subject: | Plack::Middleware::Deflater doesn't modify ETags |
Date: | Wed, 20 Mar 2019 17:26:44 +1100 |
To: | bug-Plack-Middleware-Deflater [...] rt.cpan.org |
From: | Mark Nottingham <mnot [...] mnot.net> |
In HTTP, an ETag without the "W/" flag is a strong validator; that means it needs to change if the representation data in the response changes, as per <https://httpwg.org/specs/rfc7232.html#weak.and.strong.validators>:
Show quoted text
> A "strong validator" is representation metadata that changes value whenever a change occurs to the representation data that would be observable in the payload body of a 200 (OK) response to GET.
See <https://httpwg.org/specs/rfc7231.html#representation.data> for the definition of "representation data."
In practice, this means that downstream caches will see responses from Plack::Middleware::Deflater both with the same ETag, even though they are different; this can cause confusion and difficulty in some use cases.
The general practice in these cases is to modify the ETag in a predictable way; e.g. by appending "-gzip". However, if this takes place, incoming ETags in requests would also need to be modified (so that they match properly).
--
Mark Nottingham https://www.mnot.net/