Tips for optimizing performance
Configure the recycle time
When the site is accessed for the first time and Sitefinity is activated, many operations are carried before Sitefinity can function. For example, configurations are loaded, resources are loaded, most of the modules and data providers are initialized, database connections are established, and object/relational mappings are constructed. In some cases, dynamic types also have to be constructed.
RECOMMENDATION: To improve the overall experience, configure the application pool to recycle the process as less as possible and also configure your application to start automatically after recycle. You can configure it to recycle every 24 hours, during the time when the site is least accessed. For more information about how to configure auto start, see http://www.techbubbles.com/aspnet/auto-start-web-applications-in-aspnet-40/.
This way, the user who makes the first request after the recycle, will not experience slow response, because of the initialization. You can set up the recycle periods in the advanced settings of the application pool in the IIS management console. You must also disable recycling for idle time.
Force pages to compile
When a page is served for the first time after it has been published, Sitefinity generates the markup for that page and then it passes it to ASP.NET engine for compilation. Then ASP.NET compiles the page in an assembly that is stored in a temporary folder. Then the actual page instance is created from the compiled assembly and subsequent request are served faster, because the steps for generating the markup and compilation are skipped. The compiled assembly is persistent between application restarts, but it will be invalidated and recompiled, if the page is changed and republished or, if for some reason the ASP.NET assembly cache is cleared.
RECOMMENDATION: You can create an external service, which periodically browses the site. This way it will force any not compiled page to compile.
Change the cache expiration time
Once the page is compiled the actual request processing begins. The page is instantiated and executed. The page and all controls on it go through their lifecycle to complete their business logic and generate the output HTML. Also this is the stage where all permissions are checked, all necessary data is collected from the database and etc. Once the response is generated, it could be cached before sending it to the client. By default Sitefinity caches the response allowing subsequent requests to skip the entire step.
NOTE: The response may vary for different browsers and some request conditions. This is why this step may still be executed even though the output has already been cached. For example, if the request is authenticated with credentials that allow inline editing, output cache will not take effect and this step will always be executed. When testing output cache, make sure you are logged out.
RECOMMENDATION: Set output cache expiration to much longer period. The default is 2 minutes.