cache gzipped content with proxy_pass

chrisl nginx-forum at
Mon Aug 16 16:56:47 MSD 2010


AFAIK nginx only stores plain (uncompressed) content when acting as a
caching proxy server. With gzip=on, content for gzip-accepting clients
will be compressed by the server _for_ _every_ _request_ (?).

Wouldn't it be better to have two cache files like this:


Another solution would be to add the internal variable gzip_ok to the
config variable space. Then one could add this variable to

 proxy_cache_key "...:$gzip_ok:..."

Currently I've added http_accept_enconding to the cache key, but since
there are hundreds of different permutations for the value this is not
an optimal solution.


Posted at Nginx Forum:,120314,120314#msg-120314

More information about the nginx mailing list