Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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