I am trying to squeeze some improved performance out of my server to help with page load times of some file heavy web pages.

I have read about a couple of ways to do this and I want to make sure I understand this correctly. If anyone with experience with this can comment on what I am doing I would appreciate it.

I found a directive in Zlib called zlib.output_compression and I set this to On.

From testing my site it looks like this automatically compresses php files on the fly for browsers that support gzip compression.

Correct? Am I done?

I also found a reference
http://www.zend.com/zend/art/buffering.php which mentions using this output handler:

ob_start("ob_gzhandler");

or, in php.ini:

output_handler = ob_gzhandler ;

Does anyone know if there is a difference in the two methods? Are they both doing the same thing?

Thanks.

    Hey synergypoint,

    I once did a script that would verify if the browser would accept compression, and then send the gzip file if the browser did support the compression, here is the simple code to detect:

    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip, deflate'))

    Then I would send my file. The result where quite impressive, on some file, I could save 75% bandwith 🙂.

    Hope this help. If you need more details, let me know

      Write a Reply...