Johan Kronberg
May 11, 2012
  6154
(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
How to add an Admin Mode add-on in Optimizely CMS12

How to add a new add-on with navigation and unified stylesheet

Bartosz Sekula | Jan 2, 2025 | Syndicated blog

Managing Your Graph Conventions

Recently, Optimizely released a Conventions API for manging how various fields on your CMS content are indexed by the Graph. This is an extremely...

Ethan Schofer | Dec 31, 2024

SaaS CMS and Visual Builder - Opticon 2024 Workshop Experience

Optimizely is getting SaaSy with us…. This year Optimizely’s conference Opticon 2024 took place in San Antonio, Texas. There were a lot of great...

Raj Gada | Dec 30, 2024

Copy Optimizely SaaS CMS Settings to ENV Format Via Bookmarklet

Do you work with multiple Optimizely SaaS CMS instances? Use a bookmarklet to automatically copy them to your clipboard, ready to paste into your e...

Daniel Isaacs | Dec 22, 2024 | Syndicated blog