There are many reasons for performance to avoid using the session state of IIS, but this requires another article description. The question we answer here is: does it improve performance when the page does not need session state? This is theoretically certain, as there is no need to initialize session state for the page.
As with buffering, session state can be set in two ways: through scripting or server configuration.
6.1 Shutdown session state via script
In the test, we closed the session state with the <%@ EnableSessionState = FALSE% > declaration.
<%@ EnableSessionState = FALSE% >
<% OPTION EXPLICIT
Dim FirstName
...
/app2/session_1.asp Fragment
Benchmark = 5.57 MS/page
Response time = 5.46 MS/page
difference =-0.11 milliseconds (2% reduction)
A small amount of work has been added, resulting in a slight improvement in performance. Now let's look at the second method.
6.2 Shutdown session state by setting the server
To turn off session state on the server, open the Properties page of the Web site first. From this dialog box, select the Configuration button for the Home Directory page, and then cancel enable session state under Application options. The following test script does not contain <%@ EnableSessionState = FALSE% > declaration.
Benchmark = 5.57 MS/page
Response time = 5.14 MS/page
difference =-0.43 milliseconds (7.7% reduction)
Another successful performance improvement! Now we have the following rules:
If allowed, session state is always turned off through script or server settings.