For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > May 2004 > Re: ob_gzhandler - gzdoc.php (0/1)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: ob_gzhandler - gzdoc.php (0/1)
Shane Lahey

2004-05-27, 2:31 am

On Tue, 25 May 2004 19:13:29 GMT, "Rob" <reply_@news_group.please>
wrote:

>Hello all,
>
>I heard the ob_gzhandler will speed your site. But I can't get it right.
>When I use this I get a blank page at first load, second load and other
>pages seems to be ok after the first load. I looked on php.net and found
>some code(even somebody who seems to have the same problem) but no such
>luck. There was a reference to a class but that was written a few years ago
>
>Can somebody help me out to get this to work (or explain me why not to use
>it)
>
>thanks in advance
>Rob
>


in your PHP index.php add the following in the top of the file
<?php
require_once('gzdoc.php');
?>

this will turn output buffering on for your whole page using
ob_start() & ob_implicit_flush(0);

then as the LAST line of your index.php ... add the following:
<?php
GzDocOut(9); // Send data .. compressing with gZip! *yay* :D
?>

hope this helps
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com