Gziping static files

Ryan Malayter malayter at gmail.com
Tue Jul 26 14:39:45 UTC 2011

On Fri, Jul 15, 2011 at 3:29 AM, sarim <nginx-forum at nginx.us> wrote:
> Hi,
> I know nginx's gzip module can compress files onthefly, and gzip_static
> module can serve manually gziped file.
> Now is there any module/way available to cache the onthefly compression
> ? I dont want to compress all static files manually, i want nginx to
> compress a file first, then save it to cache, then serve the cached
> gziped version as long as the main file is not changed.
> Is there any way around ?

There are rumors of a gzip cache feature coming that I have seen here.
For now, you can have nginx proxy to itself, with the intermediate
doing the compression. So it would be something like this:

nginx server on port 80/443 listening on public-facing IP
proxy_cache enabled
gzip enabled
nginx server on localhost port 20080
gzip enabled
your back-end server


More information about the nginx mailing list