Johan Kronberg
May 11, 2012
  5775
(5 votes)

Speed up Edit Mode: Set EnableSessionState to false

Did you now that if session state is enabled, the default ASP.NET setting, all requests from the same user session get queued and processed one after another? Disabling session state will make your server process all those requests simultaneously.

Of course this makes the framed Edit Mode load a bit faster since your non session page template will be processed without having to wait in line with other requests.

Another common situation is AJAX requests being sent to other EPi pages "on load". If your server can finish these at the same time you most likely will have saved quite a few milliseconds for your users.

A third scenario that most of you have seen is when you have built a Web Form that interacts with a remote HTTP service or doing something else that always or occasionally takes a lot of time to complete. You (or even worse, your user or editor) keep waiting for the page to load but then give up and try to navigate to another page. This request of course gets put in your session request queue and the only thing besides waiting that will get you to browse pages on your web site again is to restart your browser and get a new session.

Conclusion: Disabling session state for your EPiServer template ASPX files will most likely give you a big performance boost and make long running requests easier to escape.

It's really easy too, just set the property in the Page directive like this:

<%@ Page Language="C#" EnableSessionState="false" %>

You can set this setting in Web.config too but for EPiServer sites I don't recommend this since it would need to be put in the root system.webServer element and then reset in child location elements where session state status might interfere with base EPiServer functionality.

In your web site's web forms you should have a really good reason to use Session for anything so for most projects this can be done without hassle.

May 11, 2012

Comments

Please login to comment.
Latest blogs
IDX21323 - RequireNonce is true, Nonce was null

We have multiple clients configured with Azure Active Directory (Microsoft Entra) for requiring authentication when accessing their website. The...

David Drouin-Prince | Oct 1, 2023 | Syndicated blog

Minimum Detectable Effect in Optimizely Web Experimentation

Understanding Minimum Detectable Effect Minimum Detectable Effect (MDE) is a core statistical calculation in Optimizely Web Experimentation. In...

Matthew Dunn | Oct 1, 2023 | Syndicated blog

Configured Commerce - Introduction to Long-Term Support (LTS) Releases

First off, for those who have not had a chance to meet me yet, my name is John McCarroll, and I am the Technical Product Manager for the Optimizely...

John McCarroll | Sep 29, 2023

Auto-translate with OpenAI in Optimizely CMS

You can now auto-translate content using your favorite online AI service, inside the old trustworthy Episerver.Labs.LanguageManager!

Tomas Hensrud Gulla | Sep 29, 2023 | Syndicated blog