Default value of gzip_proxied

Maxim Dounin mdounin at mdounin.ru
Sat Mar 21 14:21:32 UTC 2015


Hello!

On Fri, Mar 20, 2015 at 07:41:59PM +0100, B.R. wrote:

> I recently bumped into some trouble with a client caching uncompressed data
> without understanding where it came from.
> 
> After long investigation on what appeared to be random, I narrowed it to
> the gzip_proxied
> <http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_proxied>
> directive. Return content from webserver was supposed to be *always*
> compressed (as compressed data is generally better than uncompressed
> whenever possible), but when requests coming from clients behind proxies
> resulted in MISS, the returned content was uncompressed and stored as such
> in cache... thus serving cached uncompressed data to final clients.
> 
> ​Why is the default value of that directive 'off'? What is the problem with
> sneding compressed data to proxies? Why have you decided on such a default
> value?

Because not all clients support compression, and it's not possible 
to instruct HTTP/1.0 proxies to serve compressed version only to 
some clients.  In HTTP/1.1 there is a Vary header for this, but 
nevertheless it's usually bad idea to use it as it causes huge 
cache duplication.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list