Welcome! Log In Create A New Profile

Advanced

cache gzipped content with proxy_pass

August 16, 2010 08:56AM
Hi.

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:

/data/nginx/cache/c29b7f54b2df7773722d382f4809d65029c
/data/nginx/cache/c29b7f54b2df7773722d382f4809d65029c.gz

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:

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.

Chris
Subject Author Posted

cache gzipped content with proxy_pass

chrisl August 16, 2010 08:56AM

Re: cache gzipped content with proxy_pass

Maxim Dounin August 16, 2010 10:52AM

Re: cache gzipped content with proxy_pass

chrisl August 21, 2010 07:27AM

Re: cache gzipped content with proxy_pass

adamchal May 26, 2011 08:28PM

Re: cache gzipped content with proxy_pass

SplitIce May 26, 2011 11:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 194
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready