bard Wrote:
-------------------------------------------------------
> Thanks for the pointers. As I wrote, I'd rather
> avoid gzipping in the
> backend, but if that's the only option so be it.
>
There's no reason the "backend" for your caching layer cannot be another nginx server block running on a high port bound to localhost. This high-port server block could do gzip compression, and proxy-pass to the back end with "Accept-Encoding: identity", so the back-end never has to do compression. The backend server will have to use "gzip_http_version 1.0" and "gzip_proxied any" to do compression because it is being proxied from the front-end.
There might be a moderate performance impact, but because you're caching at the "frontmost" layer, the number of back-end hits should be small.
Also note there may be better options in the latest nginx versions, or by using the gunzip 3rd-party module:
http://mdounin.ru/hg/ngx_http_gunzip_filter_module/file/27f057249155/README
With the gunzip module, you can configure things so that you always cache compressed data, then only decompress it for the small number of clients that don't support gzip compression.
--
RPM