Compressed page streams detection and optimization

Maxim Dounin mdounin at mdounin.ru
Thu Sep 12 11:54:13 UTC 2013


Hello!

On Thu, Sep 12, 2013 at 06:07:05AM -0400, dfumagalli wrote:

[...]

> What happens if Nginx gets served by PHP-FPM a compressed page and maybe 1
> compressed .css file + 5 uncompressed .css files and 6 .js?

[...]

> Or does it - hopefully - detect an incoming stream "magic numbers" or
> headers and transparently skips re-compression / wrapping?

Yes, it checks if a response is already compressed based on the 
Content-Encoding header, and only compresses the response if it's 
not.  It's usually enough to just configure/enable gzip at http{} 
or server{} level.

-- 
Maxim Dounin
http://nginx.org/en/donation.html



More information about the nginx mailing list