Starting up EPiServer CMS faster after build

At work we have a large EPiServer project, actually, several project branches that would take really long time to start up after each build. We are talking about up til 5 minutes. First we thought that it was PageTypeBuilder that was the problem, that if different developers didn't have the latest version of the code and that PageTypeBuilder would rebuild the pagetype definitions after each build and that was the reason for the long startup time. But that wasn't our problem in this case, our problem had to do with a combination between EPiServerFramework.config, source control and our build script.

This will probably not solve all your problems about EPiServer sites that are starting slowly, you will probably not even have this configuration setup but you will probably have the project under source control.

Background

First a little background about the project setup and it's configuration files. In the web-project we have a folder called [Configuration] were we have a subfolder for each target platform that we want to make a build for. I.e. "Debug", "Test" and "Release". In each subfolder we have specific configuration for that target. When we build the solution the configuration files are copied to the webroot with a build script. Theese files were checked in under source control and shared between the team.

The other day I was poking around in theese configuration files and I noticed in EPiServerFramework.config that my machine settings was missing from the <automaticSiteMapping> - there were only one setting present - the one who made the first check-in and the only developer that didn't complain about the slow startup.

EPiServer framwork will automatically update EPiServerFramwork.config with machine specific information if it's missing - and this is why it took so long time to start the site. We are talking about up til 5 minutes per build.

The <automaticSiteMapping>-tag looks something like this:

<automaticSiteMapping>
    <add key="/LM/W3SVC/4/ROOT:MyMachine" siteId="MyEPiServerSite" />
</automaticSiteMapping>

If you need to have the file under source control each developer needs to add their machine settings and check in the file. The machine settings are unique for each machine and for each project so don't copy paste between projects or developers. If you want to be nice to your fellow team members don't overwrite their settings. Make sure that the file is not readonly.

The easiest way to add your settings to the shared EPiServerFramework.config is to wait until the site has started and then open up EPiServerFramework.config in your webroot and copy the line with your information to the file that is under source control and then check in the file.

Tags

episerver cms performance EPiServerFramework.config
;