You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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."
The functionality can be enabled with the following patch:
*************** class GZipContentEncoding(OutputTransfor
*** 1670,1675 ****
--- 1670,1676 ----
("Content-Encoding" not in headers)
if self._gzipping:
headers["Content-Encoding"] = "gzip"
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).
Hi,
It's accepted practice that when you support compression, Vary: Accept-Encoding http header is sent. From:
https://developers.google.com/speed/docs/best-practices/caching
"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:
http://httpd.apache.org/docs/2.2/mod/mod_deflate.html#proxies
The functionality can be enabled with the following patch:
*************** class GZipContentEncoding(OutputTransfor
*** 1670,1675 ****
--- 1670,1676 ----
("Content-Encoding" not in headers)
if self._gzipping:
headers["Content-Encoding"] = "gzip"
I'm using tornado==2.2
The text was updated successfully, but these errors were encountered: