homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

How do you use PHP GZIP compression?
An implementation question.

 2:04 am on Jun 8, 2003 (gmt 0)

I use PHP across all the page on my web site. Sometimes the ONLY reason is use PHP is for the ob_gzhandler.

I'm pretty sure my implementation of it works in compressing the entire page (GZIP tests show that it does) I'm just curious as to how other PHP users are utilizing ob_gzhandler.

For example, if I have a web page with no PHP elements on it (other than ob_gzhandler) I put this at the top of the page:

<?php ob_start ("ob_gzhandler");?>

Does this compress the entire page? It would appear so. But, I'm still curious how others are using PHP GZIP compression on their sites.

Thanks in advance for any comments.



 2:42 pm on Jun 8, 2003 (gmt 0)

Not sure what you mean. I use this in all my programs to save bandwidth. You may want to look into the mod_gzip apache module if you make a static page a PHP page _just_ to use ob_gzhandler. It would be less overhead for you.



 1:29 pm on Jun 9, 2003 (gmt 0)

Oaf357, yes, this will compress the entire page. However, the problem with ob_gzhandler is that it doesn't cache compressed output inflicting unnecessary server load. mod_gzip does.


 1:34 pm on Jun 9, 2003 (gmt 0)

doesn't cache compressed output

storyteller - what do you mean by that?

<added> do you mean that you can not use ob_gzhandler in conjunction with a caching system (phpCache for instance)?


 3:35 am on Jun 13, 2003 (gmt 0)

What I was trying to say is that with ob_gzhandler your content get re-compressed every time it's served. mod_gzip keeps compressed content in a special directory, effectively caching it.


 10:42 pm on Jun 18, 2003 (gmt 0)

Read [php.net...]

One way to do it is with a .htaccess file including "php_value zlib.output_compression On".

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved