I.T. Discussion Community!
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

-Collapse +Expand ASP Classic Store

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite Scri...ASP ClassicLanguage Det...   Print This    All Groups  
  From the October 2015 Issue of Prestwood eMag
ASP Classic Language Details:
Response.Flush and Response.Buffer
Posted 15 years ago on 12/19/2006 and updated 4/10/2010
Take Away:

Response.Flush sends the contents of the buffer to the browser. This command is useful for showing a visitor something while slow loading pages load.


In ASP, the Response object sends output to the client browser. You can use the Response.Buffer property to indicate whether the page output is buffered. If buffered, all scripts on the page will finish processing unless you specifically call either the Flush or End method. You can set the buffer in IIS or in code using the Buffer property.

For example:

Response.Buffer = True

If the Response.Buffer property is set to True, the Flush method immediately sends all current buffered page content to the client. IIS then stops processing ASP code and waits for the browser to ping back (a very fast procedure). The use of Response.Flush is a fairly common technique for showing a page background image and page header nearly immediately to a visitor while the rest of the page is rendered. This gives visitors the feeling of a more responsive website.

Proper Use of Flush:

Response.Buffer = True
''' ...some code that outputs here (perhaps a header and body background image)

Note: If the Flush method is called, the server does not honor Keep-Alive requests for that page.

If Buffering is Off, Flush Returns an Error

If Response.Buffer is False, then Flush will return the following runtime error.

Response object error 'ASP 0157 : 80004005' 
Buffering On
/home.asp, line 15
Buffering cannot be turned off once it is already turned on.

Response.Buffer Default

In IIS 5 and above, the default for Response.Buffer is True. In IIS 4 and earlier, the default was False.

Redirects MUST come before Flush

However, once you've called Response.Flush, you cannot use Response.Redirect to redirect to another page. Therefore, all your processing that might lead to a redirect needs to occur BEFORE you call Response.Flush. I think that's okay, because your code is cleaner anyway.

This code will fail...

Response.Redirect "/"

With this error:

Response object error 'ASP 0156 : 80004005' 
Header Error
/aspsuite/estore/_opensupportaccount.asp, line 47
The HTTP headers are already written to the client browser.
Any HTTP header modifications must be made before writing page content.

Cookies and Flush

Because cookies must be written before any HTML output, you need to handle cookies prior to calling Response.Flush.

Calling Flush Multiple Times

You can use Response.Flush to show the top of your page so your visitor can start reading your page.
--Mike Prestwood

You can use Response.Flush to show the top of your page so your visitor can start reading your page. This is a common technique around tables. Because browsers render ONLY after an end table tag, it is a common technique to call Response.Flush after the table end tag and prior to starting a new table.

You can call Response.Flush as many times as you want. However, because the browser must ping back to the server, it is a best practice to limit the use of Response.Flush to just a few per page. You definately don't want to call it every time you loop through a table of say 1,000 records.


Share a thought or comment...
First Comment
Comment 1 of 12

how to use response.redirect after using response.buffer

Posted 6 years ago

Comment 2 of 12
Hi, Response.Buffter = false; Response.Write("Some Message"); Response.flush(); the above code working fine in my colleague system, but in my system not working. Why?
Posted 58 months ago

Comment 3 of 12

independent support,Official support,OEM support,independent third party support,Voice support,support phone number,support number,customer service number,customer support number,customer service phone number,customer support phone number

Posted 14 months ago

Comment 4 of 12

webroot customer service, pogo support, amazon kindle support, avg customer service, charter customer service, garmin support, lexmark support, pinterest help

Posted 14 months ago

Comment 5 of 12

webroot customer service, pogo support, amazon kindle support, avg customer service, charter customer service, garmin support, lexmark support, pinterest helpindependent support,twitter support,snapchat supportskype phone number,panasonic customer service,google home setupcarbonite phone numberavast customer service,carbonite support number , amazon prime video support number

Posted 14 months ago

Comment 6 of 12

Call the support number to get support & help from independent third party specialists to resolve the software and computer issues Call +1-865-424-1006
independent support,twitter support,snapchat supportskype phone number,panasonic customer service,google home setupcarbonite phone number,independent support,roadrunner email support,qsee support,panasonic customer service,nuance support,norton support,netgear support

Posted 14 months ago

Comment 7 of 12
HTML [url=https://www.google.com/]BB Code[/url] Anchor Text https://www.google.com/
Posted 12 months ago

Comment 8 of 12

linksys router setuplinksys setuplinksys customer servicegarmin supportgarmin support numbergarmin customer serviceamazon kindle supportamazon kindle customer servicekindle supportnetgear supportnetgear setupnetgear tech supportpogo supportpogo phone numberpogo customer service phone numbercarbonite phone numbercarbonite supportavg customer serviceavg technical support phone numberavg tech support phone numberlexmark supportlexmark printer supportlexmark printer support phone number,  netflix helpnetflix customer servicenetflix customer service numberindependent supportOfficial supportOEM supportgoogle chrome setupgoogle chrome helpchrome setuphotmail supporthotmail customer servicecontact hotmailkodakverite supportkodak customer servicekodak support,

Posted 12 months ago

Comment 9 of 12

tp link supporttp link customer servicetp link router setupnetgear supportnetgear setupnetgear tech supportavast customer serviceavast supportavast customer service numberdell supportdell customer servicedell technical supportcall alexaamazon alexa customer servicealexa supportalexa helpat&t phone numberat&t customer service numberat&t customer servicecarbonite phone numbercarbonite supportcarbonite customer service numbernorton supportnorton setupnorton tech supporthotmail supporthotmail customer servicecontact hotmailhewlett packard customer servicehewlett packard supportgoogle chrome setupgoogle chrome helpchrome setupgmail customer servicegmail supportgmail setupsbcglobal email helpsbcglobal email supportsbcglobal net email supportroadrunner email setuproad runner customer serviceroadrunner email supportlinksys router setuplinksys setuplinksys customer service,  

Posted 12 months ago

Comment 10 of 12

dell supportdell customer servicedell technical support,  brother customer servicebrother printer customer servicebrother printer setupnorton supportnorton setupnorton tech supportcontact supportcontact support numbercontact support phone numberonedrive setuponedrive supportonedrive helppinterest helpcontact pinterestpinterest phone numbercontact instagraminstagram supportinstagram helpfirefox supportfirefox helpmozilla thunderbird help,  hp supporthp support numberhp customer servicehp printer supportaol customer serviceaol customer service phone numberaol tech supportmeetme chatmeetme supportmeetme contact

Posted 12 months ago

Comment 11 of 12

apple customer serviceapple support numberapple supportat&t phone numberat&t customer service numberat&t customer servicecall at&t customer serviceverizon email support numberverizon email customer service phone numberverizon email tech support phone numberverizon email tech support numberverizon email customer service numberyahoo customer servicecontact yahoohow to contact yahooyahoo contact numberyahoo customer care numberyahoo customer service numberroadrunner email setuproad runner customer serviceroadrunner email supportroadrunner customer servicenetgear supportnetgear setupnetgear tech supportgmail customer servicegmail supportgmail setupgmail tech supportphone number for chartercharter email setupcharter support numbercharter tech support numbersbcglobal email customer servicesbcglobal email customer service phone numbersbcglobal email tech support phone numbercontact support phone numbercontact supportcontact phone numbercontact number,  bellsouth email supportbellsouth customer servicebellsouth phone,  

Posted 12 months ago

Latest Comment
Comment 12 of 12

kebanyakan pria telah sukses menggunakan cialis original 100 mg cod lippo cikarang sebagai obat kuat yang ampuh untuk berhubungan intim dengan pasangan kekasihnya. klik tautan . banyak kasus dimana pria sering kalah saat berhubungan intim sebelum mereka mengenal yang namanya cialis asli karawang oleh sebab itu tablet kuning mungil ini sangat bermanfaat bagi pria yang ingin memperbaiki tingkat ereksi yang lebih membaik. baca seterusnya . jangan sampai istri anda tidak bisa mendapatkan kepuasan hanya karena anda lemah dalam melayaninya. cialis asli semarang dapat menjawab problem biologis yang selama ini bisa menyebabkan retaknya dalam berumah tangga. cialis asli bandung dapat menjadikan hubungan pasutri anda jadi lebih harmonis ketika sedang bercinta. penyebab terbesar sulitnya ereksi adalah ketika pria menderita penyakit impotensi karena alat vital tidak mampu mengalirkan darah menuju organ-organ vital sehingga dapat menghambat terjadinya ereksi. cialis asli dapat memberikan kepuasan yang anda dambakan bersama pasangan ketika sedang bercinta. klik link ini . bagi anda yang ingin mencapai klimaks bisa mengonsumsi viagra gold usa agar istri anda bisa selalu merasakan kepuasan dalam bercinta saat berhubungan badan. klik selengkapnya . nama merk dagang tadalafil semakin dikenal dengan sebutan obat kuat cialis tadalafil yang termasuk salah satu obat untuk pembangkit semangat pria saat diranjang agar selalu tampil perkasa bersama pasangan. read more . setelah anda puas dengan tingkat ereksi yang lebih baik tidak ada salahnya jika anda mencoba vimax oil original yang juga bagus untuk pria yang ingin memperbaiki alat vital agar istri bisa lebih senang dengan ukuran yang besar dan panjang.

Posted 11 months ago
Write a Comment...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P123A1
Enter key:
KB Post Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #100421 Counter
Since 4/2/2008

Follow PrestwoodBoards on: 

©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech