Re: output buffering

From: Date: Thu, 05 Apr 2001 05:26:26 +0000
Subject: Re: output buffering
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47174@lists.php.net to get a copy of this message
http://www.php.net/manual/en/ref.outcontrol.php If you want to use output buffering you must use the ob_* family of functions. In any script where you want it used you _must_ use it explicitly, or so do in an included file. Unless you can change the php.ini, there is no way to force all pages to use output buffering. I don't reccommend you do such a thing anyway. If you aren't using output compression all it does is allow bad programming practices. One exception is for hosting companies that want to force ads to be displayed on the page with the auto_prepend type settings. Output buffering should only be used if you have a specific reason for doing so. Kind of like all PHP functions :) It doesn't cost much in performance except when a script pumps out a very large amount of data. If you want to print a 10mb text file to the browser it is a considerably _BAD_ idea to force PHP to buffer that all up into one chunk before puking it out. But, enter the gz_handler functions. If you want to compress your output, then you have a reason for using output buffering. The cost in performance varies widely, but if your server is already under a considerable load you probably shouldn't use it. But it's very cool to use if you have the extra processor power, but wait for 4.0.5 to do it. Many people complain about memory leaks and sub-standard output buffering functions. It's supposed to all be fixed in the new version, so feel free to play around with it :) Still, it's better to be able to set it only in the places you want it run rather than making all output use it. -- Plutarck Should be working on something... ...but forgot what it was. "Christian Dechery" <lemming@vento.com.br> wrote in message news:5.0.0.25.2.20010405004207.02402070@pop-gw.vento.com.br... > as I saw on the manual output_buffering cannot be changed at runtime... so > there is NO WAY? If I want output_buffering I'll have to do it on all my pages? > > and does it really cost that much in performance? is it worthed? > ____________________________ > . Christian Dechery (lemming) > . http://www.tanamesa.com.br > . Gaita-L Owner / Web Developer > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#47174) next »