Re: PHP output|Buffer, PLEASE ADVISE
| From: | Rasmus Lerdorf | Date: | Sun, 21 Sep 2003 13:37:45 +0000 |
| Subject: | Re: PHP output|Buffer, PLEASE ADVISE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163345@lists.php.net to get a copy of this message | ||
On Sun, 21 Sep 2003, nabil wrote:
> In general , when you open an html file , the browser start to display and
> draw the tables, then start to display the pictures (on slow internet
> connection).. but when you make your html code inside an php the output will
> be different, it will buffer everything then it will pop the whole page.
>
> I have a question.. how can I make php output and display my website as
> stream html..
>
> because I have a postnuke website and it take ages for popping all contents
> , but when I saved it as html and I upload it on the same apache server ,
> the home page start to be displayed picture after picture and so on ...
>
> Please any advise ??
The output won't actually be different unless you have turned on
zlib.output_compression or output_buffering in your php.ini file. Both of
these are off by default. Without these PHP will not do any buffering.
The only buffering you see is done by Apache and this buffering happens in
your static file case as well. It is natural that a static file version
of a big complex page will render faster than the PHP-generated one.
You can ask Apache to flush its internal buffer by using the flush() call
from PHP, but it really isn't advised to do that too often. Apache is
buffering in order to spew out full TCP packets for maximum efficiency.
Using flush() defeats that and your application end-to-end page delivery
time will increase.
-Rasmus