Can proxy_cache gzip cached content?

Massimiliano Mirra hyperstruct at
Tue Feb 14 12:05:29 UTC 2012


I'm looking at using Nginx as a reverse proxy to cache a few millions HTML
pages coming from a backend server.

The cached content will very seldom (if at all) change so both proxy_cache
and proxy_store could do, but all page URLs have a "/foo/$ID" pattern and
IIUC with proxy_store that would cause millions of files in the same
directory, which the filesystem might not be ecstatic about. So for now I'm
going with proxy_cache and two levels of directories. All is going great in
my preliminary tests.

Now, rather than caching uncompressed files and gzipping them before
serving them most of the time, it would be great if cached content could be
gzipped once (on disk) and served as such most of the time. This would
decrease both disk space requirements (by 7-8 times) and processor load.

Is this doable? Patching/recompiling nginx as well as using Lua are fine
with me. Serving gzipped content from the backend would in theory be
possible though for other reasons better avoided.

Thanks for any insight!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list