You can clone with
HTTPS or Subversion.
It's accepted practice that when you support compression, Vary: Accept-Encoding http header is sent. From:
"Set the Vary: Accept-Encoding response header. This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed. The correct version of the resource is delivered based on the client request header. This is a good choice for applications that are singly homed and depend on public proxies for user locality."
Apache does this:
The functionality can be enabled with the following patch:
*************** class GZipContentEncoding(OutputTransfor
*** 1670,1675 ****
--- 1670,1676 ----
("Content-Encoding" not in headers)
headers["Content-Encoding"] = "gzip"
I'm using tornado==2.2
It's a little more complicated than that, for two reasons. First, the Vary header accepts multiple values, so you need to account for the fact that the handler may have added another Vary header (and output transforms don't currently get access to list_headers). Second, the Vary: Accept-Encoding must be sent whether or not the current response is gzipped, if it could have been gzipped (so it needs to be conditioned on the Content-Type being in the allowed list, but not this requests's Accept-Encoding header).
Return a Vary: Accept-Encoding header whenever gzip is enabled.
This is one of two problems found with redbot. The other,
that etags should change when content-encoding is used, is trickier to
fix and seems to be less problematic.