Reply to Re: what is the header to stop buffering?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация