473,583 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.flush( )

Experimenting with response.flush( ) but can't seem to get it to work. This
code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple of
seconds later, when the loops finished, write ended? When I test on XP Pro
and Windows Server 2003 the flush doesnt happen - the page takes a couple of
seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon
Jul 19 '05 #1
7 6993
I believe there's a thing about certain browsers, i.e. IE, where they won't
display anything until the response they've received is of a minumum number
of bytes. I don't know what the minimum is, though. You could try adding a
line like so above the <p>started</p> line:

response.write "<!-- " & String(200, "x") & " -->"

BTW, do you know that your for-loop is essentially doing a Step 2? You
don't have to increment the looping variable.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
Experimenting with response.flush( ) but can't seem to get it to work. This
code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple of seconds later, when the loops finished, write ended? When I test on XP Pro
and Windows Server 2003 the flush doesnt happen - the page takes a couple of seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon

Jul 19 '05 #2
Hi,
thanks for the reply I tried adding some more text to my little sample and
guess what - the flush happened on my dev machine XP Pro/IIS5.1 but not my
web server IIS6/Windows Server 2003. My problem is I'm working on this site
www.bookhead.co.uk if you click any of the book links the next page pulls
the book details from sql server 2000 then uses xmlhttp to get prices for
the book from 11 retailers. The db lookup is quick, the xmlhttp part can
take about 10 seconds - so I put response.flush( ) after the db lookup, the
flush isn't happening with the result that the page takes about 10 seconds
to display - obviously unacceptable so I need to fix this

I can't post up the code for the page I'm working on its ~150 lines is there
something you can think of that would stop response.flush( ) from happening?
I've also written my host to see if they have any ideas

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:Ox******** ******@TK2MSFTN GP10.phx.gbl...
I believe there's a thing about certain browsers, i.e. IE, where they won't display anything until the response they've received is of a minumum number of bytes. I don't know what the minimum is, though. You could try adding a line like so above the <p>started</p> line:

response.write "<!-- " & String(200, "x") & " -->"

BTW, do you know that your for-loop is essentially doing a Step 2? You
don't have to increment the looping variable.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
Experimenting with response.flush( ) but can't seem to get it to work. This code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple
of
seconds later, when the loops finished, write ended? When I test on XP
Pro and Windows Server 2003 the flush doesnt happen - the page takes a

couple of
seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon


Jul 19 '05 #3
Your code work perfectly well on my XP Pro workstation, with the web server
being on the same machine.

Maybe you are separated from you Windows Server with a firewall or a proxy
who is buffering the whole thing. Your LAN may also be involved.

I suggest that you install the web server directly on you station and then
making somes tests with that configuration.

S. L.
"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
Experimenting with response.flush( ) but can't seem to get it to work. This
code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple of seconds later, when the loops finished, write ended? When I test on XP Pro
and Windows Server 2003 the flush doesnt happen - the page takes a couple of seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon

Jul 19 '05 #4
I've run into this problem before and I've yet to find a definitive answer.
I believe that it's a browser issue, actually. When I loaded your code on
my W2K server, it did not [seem to] flush just as you described. Then I
added the long comment and it worked. Then I restored the code back to
exactly what you posted and it flushed that time. Inconsistencies do not
make sense. I believe that if you quickly do a view-source while you're
waiting for your flush, you may actually see the <p>started</p> in there.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
Hi,
thanks for the reply I tried adding some more text to my little sample and
guess what - the flush happened on my dev machine XP Pro/IIS5.1 but not my
web server IIS6/Windows Server 2003. My problem is I'm working on this site www.bookhead.co.uk if you click any of the book links the next page pulls
the book details from sql server 2000 then uses xmlhttp to get prices for
the book from 11 retailers. The db lookup is quick, the xmlhttp part can
take about 10 seconds - so I put response.flush( ) after the db lookup, the flush isn't happening with the result that the page takes about 10 seconds
to display - obviously unacceptable so I need to fix this

I can't post up the code for the page I'm working on its ~150 lines is there something you can think of that would stop response.flush( ) from happening? I've also written my host to see if they have any ideas

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:Ox******** ******@TK2MSFTN GP10.phx.gbl...
I believe there's a thing about certain browsers, i.e. IE, where they won't
display anything until the response they've received is of a minumum

number
of bytes. I don't know what the minimum is, though. You could try adding a
line like so above the <p>started</p> line:

response.write "<!-- " & String(200, "x") & " -->"

BTW, do you know that your for-loop is essentially doing a Step 2? You
don't have to increment the looping variable.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
Experimenting with response.flush( ) but can't seem to get it to work.

This code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple
of
seconds later, when the loops finished, write ended? When I test on XP

Pro and Windows Server 2003 the flush doesnt happen - the page takes a

couple
of
seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon



Jul 19 '05 #5
I'm working on my laptop at the moment IIS on the same machine - no lan
firewall proxy etc. The real issue here is the site I'm working on that I
posted up earlier - not being able to get response.flush working is ruining
the site.

Just for the heck of it I uploaded Ray's code with the long string here
http://www.roksteady.net/flushed.asp

The flush works on my dev machine but is not happening on the web server -
running IIS6 Windows Server 2003. Also tested in Netscape 7 and firebird
just to be sure it isn't an IE thing. I wonder if response.flush( ) is
somewhat flakey or there is something I'm missing here. Either way I need to
get to the bottom of this

Jon

"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:Op******** ******@tk2msftn gp13.phx.gbl...
Your code work perfectly well on my XP Pro workstation, with the web server being on the same machine.

Maybe you are separated from you Windows Server with a firewall or a proxy who is buffering the whole thing. Your LAN may also be involved.

I suggest that you install the web server directly on you station and then
making somes tests with that configuration.

S. L.
"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
Experimenting with response.flush( ) but can't seem to get it to work. This code
<%
response.write "<p>started </p>"
response.flush( )
for i = 1 to 10000000
i = i +1
next
response.write "<p>ended</p>"
%>
Should it not write started to the screen straight away and then a couple
of
seconds later, when the loops finished, write ended? When I test on XP
Pro and Windows Server 2003 the flush doesnt happen - the page takes a

couple of
seconds to load up and then writes started ended at the same time.

Also found this article on aspfaq
http://www.aspfaq.com/show.asp?id=2498
but the response.flush( ) doesn't happen with that sample code either

Any ideas?

Jon


Jul 19 '05 #6
As far as I can see this must be a server issue - from my testing the exact
same pages that refuse to flush on my IIS6 web server flush perfectly on 2
IIS5.1 computers here. Still trying to get to the bottom of this but running
out of ideas.....

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:uj******** ******@tk2msftn gp13.phx.gbl...
I've run into this problem before and I've yet to find a definitive answer. I believe that it's a browser issue, actually. When I loaded your code on
my W2K server, it did not [seem to] flush just as you described. Then I
added the long comment and it worked. Then I restored the code back to
exactly what you posted and it flushed that time. Inconsistencies do not
make sense. I believe that if you quickly do a view-source while you're
waiting for your flush, you may actually see the <p>started</p> in there.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
Hi,
thanks for the reply I tried adding some more text to my little sample and guess what - the flush happened on my dev machine XP Pro/IIS5.1 but not my web server IIS6/Windows Server 2003. My problem is I'm working on this

site
www.bookhead.co.uk if you click any of the book links the next page pulls the book details from sql server 2000 then uses xmlhttp to get prices for the book from 11 retailers. The db lookup is quick, the xmlhttp part can
take about 10 seconds - so I put response.flush( ) after the db lookup,

the
flush isn't happening with the result that the page takes about 10 seconds to display - obviously unacceptable so I need to fix this

I can't post up the code for the page I'm working on its ~150 lines is

there
something you can think of that would stop response.flush( ) from

happening?
I've also written my host to see if they have any ideas

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:Ox******** ******@TK2MSFTN GP10.phx.gbl...
I believe there's a thing about certain browsers, i.e. IE, where they

won't
display anything until the response they've received is of a minumum

number
of bytes. I don't know what the minimum is, though. You could try adding
a
line like so above the <p>started</p> line:

response.write "<!-- " & String(200, "x") & " -->"

BTW, do you know that your for-loop is essentially doing a Step 2? You don't have to increment the looping variable.

Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:ua******** ******@tk2msftn gp13.phx.gbl...
> Experimenting with response.flush( ) but can't seem to get it to

work. This
> code
> <%
> response.write "<p>started </p>"
> response.flush( )
> for i = 1 to 10000000
> i = i +1
> next
> response.write "<p>ended</p>"
> %>
> Should it not write started to the screen straight away and then a

couple
of
> seconds later, when the loops finished, write ended? When I test on
XP Pro
> and Windows Server 2003 the flush doesnt happen - the page takes a

couple
of
> seconds to load up and then writes started ended at the same time.
>
> Also found this article on aspfaq
> http://www.aspfaq.com/show.asp?id=2498
> but the response.flush( ) doesn't happen with that sample code either
>
> Any ideas?
>
> Jon
>
>



Jul 19 '05 #7
Did some more searching and found the answer - it seems IIS6 has some
performance issues with response.flush with a fix due in the first SP
http://groups.google.com/groups?hl=e...TF-8%26hl%3Den

Solved my own issue with a very nasty hack
do db lookup then stop
javascript to redirect to the same page
finish processing page
This accomplishes almost the same thing as response.flush( ) but we shouldn't
have to do things like this on supposedly "better" products

Jon

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
As far as I can see this must be a server issue - from my testing the exact same pages that refuse to flush on my IIS6 web server flush perfectly on 2
IIS5.1 computers here. Still trying to get to the bottom of this but running out of ideas.....

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in message
news:uj******** ******@tk2msftn gp13.phx.gbl...
I've run into this problem before and I've yet to find a definitive answer.
I believe that it's a browser issue, actually. When I loaded your code on
my W2K server, it did not [seem to] flush just as you described. Then I
added the long comment and it worked. Then I restored the code back to
exactly what you posted and it flushed that time. Inconsistencies do not make sense. I believe that if you quickly do a view-source while you're
waiting for your flush, you may actually see the <p>started</p> in there.
Ray at work

"Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
Hi,
thanks for the reply I tried adding some more text to my little sample and guess what - the flush happened on my dev machine XP Pro/IIS5.1 but not my
web server IIS6/Windows Server 2003. My problem is I'm working on this site
www.bookhead.co.uk if you click any of the book links the next page pulls the book details from sql server 2000 then uses xmlhttp to get prices for the book from 11 retailers. The db lookup is quick, the xmlhttp part
can take about 10 seconds - so I put response.flush( ) after the db lookup, the
flush isn't happening with the result that the page takes about 10

seconds to display - obviously unacceptable so I need to fix this

I can't post up the code for the page I'm working on its ~150 lines is

there
something you can think of that would stop response.flush( ) from

happening?
I've also written my host to see if they have any ideas

Jon

"Ray at <%=sLocation% >" <myfirstname at lane34 dot com> wrote in
message news:Ox******** ******@TK2MSFTN GP10.phx.gbl...
> I believe there's a thing about certain browsers, i.e. IE, where they won't
> display anything until the response they've received is of a minumum
number
> of bytes. I don't know what the minimum is, though. You could try

adding
a
> line like so above the <p>started</p> line:
>
> response.write "<!-- " & String(200, "x") & " -->"
>
> BTW, do you know that your for-loop is essentially doing a Step 2?

You > don't have to increment the looping variable.
>
> Ray at work
>
> "Jon Spivey" <jo*******@NOCR APTHANKStiscali .co.uk> wrote in message
> news:ua******** ******@tk2msftn gp13.phx.gbl...
> > Experimenting with response.flush( ) but can't seem to get it to work. This
> > code
> > <%
> > response.write "<p>started </p>"
> > response.flush( )
> > for i = 1 to 10000000
> > i = i +1
> > next
> > response.write "<p>ended</p>"
> > %>
> > Should it not write started to the screen straight away and then a
couple
> of
> > seconds later, when the loops finished, write ended? When I test on XP
Pro
> > and Windows Server 2003 the flush doesnt happen - the page takes a
couple
> of
> > seconds to load up and then writes started ended at the same time.
> >
> > Also found this article on aspfaq
> > http://www.aspfaq.com/show.asp?id=2498
> > but the response.flush( ) doesn't happen with that sample code

either > >
> > Any ideas?
> >
> > Jon
> >
> >
>
>



Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2579
by: Copa | last post by:
Hello, I am testing buffering an asp page and Flushing information out to the browser, hence i wrote the code in an asp page that follows this Message Post. The loops are suppose to simulate long search processes with a flush after each search. When i Navigate to the page, redirect to it from another page, or type the URL to this page in...
9
4139
by: Dominic Godin | last post by:
Hi, I have an asp page that does a lot of processing and reports it's finished by printing the word "Success". For example: <% SomeFunction(SomeVar) SomeFunction(SomeVar1) SomeFunction(SomeVar3)
5
2496
by: Luiz Vianna | last post by:
Guys, I need to send some info to my client while I'm processing some stuff. The flow will be something like : -process -response -process -response .... I imagine to use response.flush (as I did on ASP) but it does not work. See my test code, after sending 2 lines on response, I'm simulating a processing time before sending other 2...
1
4461
by: Dan | last post by:
Hi I've created a generic 'Report' class that takes a DataView from a DataGrid control and writes it out to the response as a csv file for download. Basically, when a user clicks the download button on the page, this class is instantiated and the download method called. The odd thing is you get the Save/Open dialog popup twice!! Any ideas...
2
4167
by: David Union | last post by:
Hi. I'm posting this here because I don't know exactly what the best group is. This is for an aspx page with Visual Basic as the code-behind page. I am doing very simple code... in the middle of an http request, i set a filename (with path) and do a Response.WriteFile(filenamewithpath) then Response.End(). I have tried Response.Clear()...
4
5847
by: Mantas Miliukas | last post by:
Hi, I have problem when flushing the generated HTML code to the client. It seems that "Page.Response.Flush()" method doesn't work at all. See my code below: protected override void Render(HtmlTextWriter writer) { for (int i = 0; i < 100; i ++) {
3
1839
by: Lars Netzel | last post by:
I want to press a Linkbutton (in a DatagridItem) and return a file that is not shared in the IIS. I want to disallow "deeplinking". The following code works fine (it sends the file I want) but I want it to be parallel to the webpage, not replacing the page with the datagrid.. how do I force the file download to a new window? Public Sub...
0
4182
by: jose.mendez22 | last post by:
I'm trying to fire a pop-up window before I execute a lengthy stored procedure so I may utilize this window as a status window on number of records executed. After my response.write statements which include the javascript I call the flush mehtod, which seems is ignored? However when I mimic the same process using a loop (and no ado object)...
12
7893
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when...
0
7811
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8314
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7922
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8185
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.