Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB7
Expertise: beginner
Feb 10, 2003



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Disabling the session state to improve performances

Sessions management consumes server's resources and memory, thus, if you don't use them in your application, you should disable them to improve performances. You can disable sessions for the entire application by setting to False the mode attribute in the web.config's <sessionState> tag, as follows:

<sessionState mode="Off" />
If you generally need session variables, but have some pages that don't use them, you can disable session state just for those pages, by setting to False the EnableSessionState attribute in the @ Page directive, as shown below:

<%@ Page EnableSessionState ="False" …other attributes…%>
If you use session variables, but just in read mode, and don't need to write them, you can set the EnableSessionState attribute to ReadOnly. The performances will not be as good as with disabled sessions, but it will still be better than with enabled sessions.
Marco Bellinaso
Comment and Contribute






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



Thanks for your registration, follow us on our social networks to keep up-to-date