468,272 Members | 1,985 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

what is the header to stop buffering?

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

Oct 28 '06 #1
5 2600
la***********@zipmail.com wrote:
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?
Disable output buffering in php.ini

output_buffering = Off

but it will not work!

PHP will spew out characters as fast as it has them, then Apache (or
whatever your webserver is) will get hold of them and buffer them :)
So you need to stop Apache (or ...) from buffering (I don't know how to
do that ... you might want to ask in an appropriate newsgroup). If you
manage that, then you'll have proxies, firewalls, routers, ..., between
the webserver and the client browser. They all /may/ add buffering on
their own. Even if they don't, the client browser /may/ buffer the
incoming data before displaying it.

So ... don't worry about it!

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Oct 28 '06 #2
la***********@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.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 29 '06 #3
I had a similar problem that the flush commands did not resolve.

Called my hosting ISP - techie there found that something called "mod_gzip"
was 'on' - turned it 'off' and problem solved.

Hope it helps

Regards
Dave
<la***********@zipmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
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


Oct 29 '06 #4
"Jerry Stuckle" <js*******@attglobal.netpíse v diskusním príspevku
news:Ad******************************@comcast.com. ..
la***********@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>

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)

Oct 30 '06 #5
Petr Vileta wrote:
"Jerry Stuckle" <js*******@attglobal.netpíse v diskusním príspevku
news:Ad******************************@comcast.com. ..
>la***********@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.
js*******@attglobal.net
==================
Oct 30 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Bob Garbados | last post: by
5 posts views Thread by skeeterbug | last post: by
2 posts views Thread by I. Adler | last post: by
4 posts views Thread by Anil | last post: by
3 posts views Thread by Chandra | last post: by
reply views Thread by Dean Hallman | last post: by
3 posts views Thread by Bob Murdoch | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.