We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 11,528 times

Related Categories

To buffer or not to buffer

Under IIS 4.0, buffering is disabled by default. This means that your
ASP page is streamed out to the browser as it's processed. This often
gives the illusion of a more responsive page, as a certain amount of
the page can be rendered while time-consuming processes, such as
database calls, are performed; however, the downside is that you can't
redirect to another page once the HTTP headers have been sent to the
browser. This happens immediately, the first time you call
response.write or certain other methods.

Under IIS 5.0, we have the opposite situation: buffering is enabled by
default. This means that the entire ASP page is processed and
interpreted before anything is sent to the browser. Consequently, you
can redirect as often as you like, but users may get to stare at a
blank browser window while your database queries or other time-
consuming script executes.

Both choices are valid in certain circumstances. You can take the
driver's seat by deciding for yourself on a page-by-page basis
which to use. The buffer property of the response object allows
you to exercise programmatic control over this. Simply set

Response.Buffer = True

to turn buffering on, or set the property to false to turn it off.
Experiment to decide which is appropriate for your needs.

© 2001 Element K Journals, a division of Element K Press LLC ("Element K"). Element K and the Element K logo are trademarks of Element K LLC

Comments