RE: Output Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can buffer your output and control how much of a buffer to use (so
it will flush the output and send to the web server to send to the
client) when the buffer is full, but the buffer, I believe, is also
automatically flushed periodically whether it's full or not.

You can do an implicit_flush, which forces a "flush()" after each output
operation, or you can manually "flush()" when you want to send the
output to the web server.   I highly recommend AGAINST turning
"implicit_flush()" on because flushing constantly usually slows down the
process and isn't really necessary, but it's nice to have the option if
you need it.

You can also turn off your output buffer (the default? Maybe not.. I
forget),BUT!!..  The web server usually has some kind of output
buffering as well.

ALSO.. Another thing to keep in mind is that some operations on the
browser side don't render until they receive certain amounts of
information.  If you send a table to a web browser, it'll wait to see
the "</table>" tag before rendering, if possible, so that it knows how
everything's going to play out visually.


So you have multiple buffers that are working together:

1. PHP's output buffer
2. Your web server's output buffer
3. Your web browsers rendering/display buffer

All of these buffers have the potential to hold things until they're
ready to do something with it or their buffers fill up.

If you want to test it all, try outputting a large amount of data (or at
least doing more than 1 through 10 with a 1 second delay) and trying
differen't flushing and buffer size options in PHP and do some research
on the output buffering in your web server.    I believe I was reading
about someone who had had some fun issues with IIS and buffering output,
but I don't know anything about Apache's buffering practices.


Hope this helps shed a little light on the situation.  



> -----Original Message-----
> From: Jason Barnett [mailto:jasbarne@xxxxxxxxxxx] 
> Sent: Thursday, May 27, 2004 3:11 PM
> To: php-windows@xxxxxxxxxxxxx
> Subject: Re:  Output Control
> 
> 
> OK, that's news to me.  Could you help explain this to the 
> class?  And 
> yes, I've put in some effort trying to understand this 
> already :)  Every 
> time I execute a script (a la Apache) I don't get any output until 
> execution finishes.
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux