Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VBS,IIS5
Expertise: beginner
Sep 23, 2000

Buffering is on by default in IIS 5

You can speed up ASP by adding the following statement at the beginning of an ASP page:

Response.Buffer = True
This statement must be executed before any HTML text is sent to the client. When buffering is on, ASP sends data to the client browser only when the page has been processed, or when it encounters a Response.Flush statement. This often delivers better overall performance, even though the user might perceive a worse apparent speed, because the browser won't be able to render the HTML until the page has completed its processing.

There are other reasons for enabling buffering. For example, a few methods and properties of th Response object - most notably, the Cookies collection, the AddHeader method, and the Status property - work only if no HTML has been sent to the client, therefore you must enable buffer if you want to use in the middle of the ASP page, when some HTML has been already produced.

Unlike IIS4, buffering is on by default under IIS5. This means that you don't need an explicit Response.Buffer = True statement at the beginning of every ASP page, and that your previous IIS4 application will run faster without any change in the code.

However, there is a gotcha: if you upgrade from IIS4 to IIS5 under Windows 2000, buffering might still be False by default. This means that, for example, if you test your site on your local IIS5 machine and then move it to the production server (another IIS5, but with another default buffer setting) your ASP application might not work as expected. The bottom line is: if you want to be absolutely sure that your ASP application works on any IIS5 installation you should explicitly add a Response.Buffer = True statement.

Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap