Forum Moderators: coopster

Message Too Old, No Replies

zlib vs. mod_gzip vs. gzhandler

i'm confused!

         

javahava

6:50 pm on Sep 12, 2004 (gmt 0)

10+ Year Member



I currently use <?php ob_start ("ob_gzhandler");?> at the top of all of my php pages.

I've learned a better solution would be to move to something like mod_gzip or zlib (http://us2.php.net/zlib); is this right? Some questions:

1.) If all my pages are php, I'm sensing that zlib would be the better solution? What exactly is the benefit to using zlib vs. gzhandler?

2.) Regarding installation of zlib; I'm assuming this is something I can ask my hosting company to do (I use a managed dedicated server). I've read that I should also manually go back and remove the gzhandler line of code on top of all my pages (<?php ob_start ("ob_gzhandler");?>), right?

Thanks for your help and thoughts on how best to compress php pages.

RonPK

8:08 am on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most *nix boxes nowadays come with zlib installed, AFAIK. Try running 'man zlib' to find out. Or check the output of phpinfo() for any information about zlib: is '--with-zlib' among the configuration commands?

mod_gzip is quite easy to install, as recompiling Apache is not necessary. Another advantage is that it not only compresses PHP output, but static HTML as well.