Nginx Fastcgi_cache performance - Disk cached VS tmpfs cached VS serving static file

ddutra nginx-forum at
Fri Oct 4 16:52:28 UTC 2013

Thank you again.

About my tests, FYI I had httpauth turned off for my tests.

I think you nailed the problem.

This is some new information for me.

So for production I have a standard website which is php being cached by
fastcgi cache. All static assets are served by nginx, so gzip_static will do
the trick if I pre-compress them and it will save a bunch of cpu.
What about the cached .php page? Is there any way of saving the gziped
version to cache?

Another question - most static assets are being worked in some way by
ngx_pagespeed and the optimized assets are cached. That means .js, .css and
images too. How does gzip works in this case? nginx gzips it everytime it
gets hit? ngx_pagespeed caches gzipped content? I am confused.

Maybe it would be better to drop ngx_pagespeed, bulk optimize every image on
source, minify all .js and .css, and let it all run on nginx without
ngx_pagespeed cache. Can you share you experience on that?

And one last question, is there any way to output $gzip_ratio on the
response headers in order to do a easy debbuging?

Later i'll do some more sieging with gzip comp level at 1 and off and i'll
post it here.

Best regards.

Posted at Nginx Forum:,243412,243444#msg-243444

More information about the nginx mailing list