Johan Kronberg
May 11, 2012
(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


Please login to comment.
Latest blogs
Zombie Properties want to Eat Your Brains

It’s a story as old as time. You work hard to build a great site. You have all the right properties – with descriptive names – that the content...

Joe Mayberry | Mar 29, 2023 | Syndicated blog

Optimizely finally releases new and improved list properties!

For years, the Generic PropertyList has been widely used, despite it being unsupported. Today a better option is released!

Tomas Hensrud Gulla | Mar 28, 2023 | Syndicated blog

Official List property support

Introduction Until now users were able to store list properties in three ways: Store simple types (int, string, DateTime, double) as native...

Bartosz Sekula | Mar 28, 2023

New dashboard implemented in CMS UI 12.18.0

As part of the CMS UI 12.18.0 release , a new dashboard has been added as a ‘one stop shop’ to enable editors to access all of their content items,...

Matthew Slim | Mar 28, 2023