473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 2752
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
5
by: skeeterbug | last post by:
so, no output can occur before a header is called. i think this means that... if i have a relatively positioned top div, a left div and a right div (both below top div) and i want to run some...
11
by: pinbot | last post by:
As far as I know, http headers should not work after content has been written. This is how my production box is working, but for some reason on my dev box I was getting away with a location header...
2
by: I. Adler | last post by:
hi when the user is pressing the stop button in the browser toolbar my aspnet code on the server ist still runnig! how can i stop this code on the webserver? the stop button doesnt fire any...
4
by: Anil | last post by:
Question related to ASP.Net web application with .Net Framework 1.1. I am using ADO.Net and ODBC namespace. When the user clicks the process button I am doing database INSERT/UPDATRE.....
3
by: Chandra | last post by:
What happens to a cancelled http request from the server perspective? Here's the scenario. I request a page from the web server and page requires lot of processing. Before the response comes...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
3
by: Bob Murdoch | last post by:
I'm using the following to send a binary file to a user: Response.AddHeader('Content-Disposition','attachment;filename=' + Request('FileName') + ';'); var vType = 'application/octetstream';...
2
by: JRough | last post by:
I have this code that switches templates depending on if the user fills in a form with a request. The request asks for the $mark & $number. If that request gets input then it displays a list...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.