|
Posted by Jerry Stuckle on 10/30/06 03:28
Petr Vileta wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> píse v diskusním príspevku
> news:AdydnSBDeabyg9nYnZ2dnUVZ_oWdnZ2d@comcast.com...
>
>> laredotornado@zipmail.com wrote:
>>
>>> Hi,
>>>
>>> I'm using PHP 4.4.4. What is the header I need to send in order for
>>> output to be continuously sent to the client browser as opposed to it
>>> being buffered and all sent at once?
>>>
>>> Thanks, - Dave
>>>
>>
>> Dave,
>>
>> There aren't any headers you can send. However, you can cause the
>> data to be sent to the browser immediately with:
>>
>> ob_flush();
>> flush();
>>
>> This will cause PHP to flush the output immediately, and generally
>> Apache will do the same. Whether or not it will be displayed
>> immediately, however, is up to the browser.
>>
> And a little trick for browser is to send 1024 or more spaces anywhere
> where it is possible in html content.
> Example:
>
> <p>some text which should be unbuffered</p>
> .....1024 spaces here...
> <?php ob_flush(); flush(); ?>
> <p>another text</p>
>
That depends on the buffer size. 1024 may be large enough - or it may not.
Plus it raises your bandwidth 1K every time you do it - not to mention
the extra download time the client requires, especially if it's a
dial-up connection.
Not a real good idea, actually.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|