[PHP] ob_start() and ob_gzhandler
Just wondering what would cause the following: I have a 512/128 cable connection through my ISP that I'm hosting my sites through. I have a 10gb/mo transfer limit (u/l and d/l) so when I saw mention of the ob_gzhandler (and mod_gzip for Apache), that kind of got me interested in it. Anyway, I created a test page, put -just- ?php ob_start(); ? at the top, then some lines of HTML, and loaded it. I got all the HTML code displayed - shouldn't I have gotten a white screen since I had no ?php ob_flush(); ? tag at the bottom? This isn't making sense. Then I tried ?php ob_start(ob_gzhandler); ? and ?php ob_flush(); ? at the bottom - same results. Am I doing something wrong? Shouldn't the ob_start() by itself just load all output into a buffer and not display it until I call ob_flush ()? And how would I know if ob_gzhandler works? I'm running PHP and Apache on Windoze, PHP is version 4.2.0 I think, Apache is 1.3.something. TIA Jason Soza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start() and ob_gzhandler
Jason Soza wrote: Just wondering what would cause the following: I have a 512/128 cable connection through my ISP that I'm hosting my sites through. I have a 10gb/mo transfer limit (u/l and d/l) so when I saw mention of the ob_gzhandler (and mod_gzip for Apache), that kind of got me interested in it. Anyway, I created a test page, put -just- ?php ob_start(); ? at the top, then some lines of HTML, and loaded it. I got all the HTML code displayed - shouldn't I have gotten a white screen since I had no ?php ob_flush(); ? tag at the bottom? This isn't making sense. Then I tried ?php ob_start(ob_gzhandler); ? and ?php ob_flush(); ? at the bottom - same results. Am I doing something wrong? Shouldn't the ob_start() by itself just load all output into a buffer and not display it until I call ob_flush ()? And how would I know if ob_gzhandler works? I'm running PHP and Apache on Windoze, PHP is version 4.2.0 I think, Apache is 1.3.something. If you don't manually flush a buffer I believe it auto flushes when the preprocessor completes. Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start() and ob_gzhandler
On Fri, 17 May 2002, Jason Soza wrote: Am I doing something wrong? Shouldn't the ob_start() by itself just load all output into a buffer and not display it until I call ob_flush ()? Or when you get to the end of execution... http://php.net/ob_implicit_flush miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start() and ob_gzhandler
Hmmm... So if I -wanted- to buffer the entire page using ob_gzhandler, I wouldn't use ob_implicit_flush(), correct? Or would this be beneficial in this case? The way I read the manual page on ob_implicit_flush() is that it flushes after each output call. Would that mean that ob_start(ob_gzhandler) would compress the output, then ob_implicit_flush() would display that compressed output at each call? Either way, is there any way to tell if my output is really being compressed by ob_gzhandler? Jason Soza - Original Message - From: Miguel Cruz [EMAIL PROTECTED] Date: Friday, May 17, 2002 10:39 am Subject: Re: [PHP] ob_start() and ob_gzhandler On Fri, 17 May 2002, Jason Soza wrote: Am I doing something wrong? Shouldn't the ob_start() by itself just load all output into a buffer and not display it until I call ob_flush ()? Or when you get to the end of execution... http://php.net/ob_implicit_flush miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start() and ob_gzhandler
You can just set output_handler in your php.ini file to automatically buffer and compress everything. On Fri, 17 May 2002, Jason Soza wrote: Hmmm... So if I -wanted- to buffer the entire page using ob_gzhandler, I wouldn't use ob_implicit_flush(), correct? Or would this be beneficial in this case? The way I read the manual page on ob_implicit_flush() is that it flushes after each output call. Would that mean that ob_start(ob_gzhandler) would compress the output, then ob_implicit_flush() would display that compressed output at each call? Either way, is there any way to tell if my output is really being compressed by ob_gzhandler? Jason Soza - Original Message - From: Miguel Cruz [EMAIL PROTECTED] Date: Friday, May 17, 2002 10:39 am Subject: Re: [PHP] ob_start() and ob_gzhandler On Fri, 17 May 2002, Jason Soza wrote: Am I doing something wrong? Shouldn't the ob_start() by itself just load all output into a buffer and not display it until I call ob_flush ()? Or when you get to the end of execution... http://php.net/ob_implicit_flush miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_start() and ob_gzhandler
On Saturday 18 May 2002 02:48, Jason Soza wrote: Either way, is there any way to tell if my output is really being compressed by ob_gzhandler? If you have NN4.X use view source, if the source is empty then compression is active. If you're using some form of un*x then: lynx --mime_header http://www.domain.com/page.php -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If only God would give me some clear sign! Like making a large deposit in my name at a Swiss Bank. - Woody Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php