[ANNOUNCE] gunzip filter module 0.3

Maxim Dounin mdounin at mdounin.ru
Tue Mar 23 16:46:58 MSK 2010


Hello!

On Tue, Mar 23, 2010 at 08:13:10AM -0500, Ryan Malayter wrote:

> Ver interesting, Maxim.
> 
> I was wondering if this works with proxy_cache... will it unzip
> compressed responses from cache?

Yes.

> If so, it would make a lot of sense to write something that would
> compress items *before* putting them into cache, even if the backend
> has not compressed them. And we could use a high compress-level if the
> item is cachable. Since 95% of clients support gzip, this would seem
> to be the ideal way to run an HTTP proxy (compression is done once per
> stored object, and decompressed on the fly if necessary for a
> particular client).
> 
> Any thoughts on that? Would an additional proxy_cache_gzip module be a
> good idea, or would it have to be a patch to the main proxy_cache
> module?

I belive proxy_cache must cache response as it was got from 
upstream.  It is not it's business to compress or change anything, 
there are output filters to do changes.

On the other hand it is believed to be good idea to implement 
cache support in gzip filter.  I.e. gzip filter will cache gzipped 
content and will send it to client instead of re-compressing it.  
And it's actually in Igor's plans AFAIK, but most likely not near 
plans.

> I suppose something similar could be done right now by having an extra
> proxy layer (a "fetcher/compressor" layer) behind the cache, but that
> seems like a hack.

Yes, this can be done easily with additional proxy layer.

Maxim Dounin



More information about the nginx mailing list