Compression with Caching

Maxim Dounin mdounin at mdounin.ru
Mon Sep 1 09:41:32 UTC 2014


Hello!

On Mon, Sep 01, 2014 at 03:20:23AM -0400, nginxsantos wrote:

> Any thoughts on this?

As you already found out, nginx stores responses as got from the 
backend server.  If you want to store compressed responses - they 
have to be returned compressed by the upstream.  If your upstream 
server doesn't do this - you can add an additional proxy layer 
(e.g., in the same nginx instance) to do this.

Note though, that if you'll store compressed responses in the 
cache, you'll have to take care of uncompressing them as 
appropriate for clients which doesn't support compression (gunzip 
module can do this, see http://nginx.org/r/gunzip).  

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list