Performance three, enable buffering to the performance impact how much?
If buffering is enabled, the server does not send page content to the browser until the entire page is processed. Buffering can be enabled in two ways: by setting the Response.Buffer property within an ASP page, or by using the server settings. The two methods are tested separately below.
3.1 Enabling buffering via script
Adding Response.buffer=true,iis to the front of the ASP script will buffer the page content:
<% OPTION EXPLICIT
Response.Buffer = True
Dim FirstName
...
/app1/buffer__1.asp Fragment
Best record = 7.05 ms/page
Response time = 6.08 MS/page
difference =-0.97 milliseconds (13.7% reduction)
Efficiency has been greatly improved, but there are better.
3.2 Enabling buffering by configuring the server
Buffering is turned on by default in IIS 5.0 and II4 4.0 requires manual setup. Set the method as follows: Open the Properties dialog box for the Web site. In this dialog box, select the Configuration button on the Home Directory page, and then under Application options, select Enable buffering. We removed the Response.Buffer statement prior to this test.
Best record = 7.05 ms/page
Response time = 5.57 MS/page
difference =-1.48 milliseconds (21% reduction)
This is the fastest response we've seen so far, with a 21% lower response time than the best record ever. From now on, the following tests will be used as a benchmark for this result.
3.3 views
Buffering is an excellent way to improve performance, so it is important to set the server to enable buffering by default. If for some reason, enabling buffering causes the page to behave abnormally, simply add response.buffer=false to the page. When buffering is enabled, the user will not see anything until the entire page is processed, which is a disadvantage. Therefore, for complex pages, it is a good choice to occasionally invoke Response.Flush to update the browser content.
Now we have the following rule:
Buffering is always enabled through the server configuration.