INFO: Response.Buffer is ON by Default in Internet Information Server 5.0

ID: Q245198


The information in this article applies to:
  • Active Server Pages
  • Microsoft Internet Information Server version 5.0


SUMMARY

In Internet Information Server (IIS) 5.0 Response.Buffer property is ON (set to TRUE) by default, which is a change from Internet Information Server 4.0. To illustrate this, run the following Active Server Pages (ASP) code in Internet Information Server 4.0 and Internet Information Server 5.0:


<%
    Response.Write "Before" & "<BR>"
    Response.Buffer = FALSE
    Response.Write "After" & "<BR>"
%> 
When you execute this code in Internet Information Server 5.0, the following error message appears:
Response object, ASP 0157 (0x80004005)
Buffering On
Buffering cannot be turned off once it is already turned on.
When you execute this code in Internet Information Server 4.0, the following appears:

Before
After 


MORE INFORMATION

This design change gives the following advantages:

  • You'll see improved performance
  • If an error occurs in your ASP code, IIS displays a custom error page instead of the error message inline in the page.
  • You can set headers and cookies at any point in the page, not just before you send any content.

  • You can also redirect at any point in the page.
The only caveat to buffering is that users have to wait until the entire page is rendered.

To turn buffering off in IIS 5.0, start the Internet Services Manager, and right-click the virtual folder in which you wish to turn buffering off. Select Properties, and then click the Configuration button. The setting for buffering is on the page named App Options. Clear the check box for Enable buffering, and then click OK.

Additional query words:

Keywords : kbASP kbGrpASP kbDSupport kbiis500
Version : winnt:5.0
Platform : winnt
Issue type : kbinfo


Last Reviewed: December 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.