Are there any benefits to using Apache2s' mod_deflate compression over setting zlib.output_compression = On and zlib.output_compression_level = 1 in php.ini?

I'm trying to come up with a good compression strategy which compresses all PHP output, plus.css and .js files.


The compression settings in your php.ini naturally only work with PHP scripts. If you want to compress your assets too, you need to use your Apache httpd's facilities.

  • Thanks. I guess I should have asked if there is any benefit to splitting up the compression duties between PHP and Apache2, or should I just use Apache2 to compress everything? The php.ini zlib seems to compress all PHP output perfectly with very minimal CPU overhead when set to level 1. – Jeff Dec 8 '09 at 17:15
  • Followup... my research seems to show that using zlib in php.ini instead of Apache2s' mod_deflate speeds up output of PHP a little bit. – Jeff Dec 9 '09 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.