Sitefinity CMS startup process

The Sitefinity CMS web application startup process leverages the standard .NET application startup logic. There are, however, a few Sitefinity CMS specifics to be aware of during the system startup or upgrade phases.

The startup process is invoked in the Init() method of the SitefinityHttpModule. The method is executed asynchronously as a background task. In the meantime, the Sitefinity CMS application is responsive and returns the current status. The diagram below demonstrates the execution flow of the Bootstrap method, including default functions and custom logic:

SF_Startup

The actual system initialization, including the core system initialization and module's initialization, occurs in the SystemManager.Initialize() method. The following diagram looks into detail in the system initialization process:

SF_InitializeSystem

All modules are initialized in the system. During initialization, the system invokes the installation or upgrade procedures, if needed. Next, the system collects information about the modules' managers and aggregates their data mapping. That is, registers all metadata mappings at once, instead of doing it for each module separately, which boosts the application performance. This process occurs between the Initialize Active Modules and Load Registered Modules steps in the diagram above.

Finally, the system calls the Load() method of each module. The Load() method is where any logic for integration with the system and other modules is implemented. The following diagram demonstrates the flow of the initialization of a single module in Sitefinity CMS:

SF_InitializeModule

In case the module is not installed or upgraded, the system forces the modules manager providers to upgrade and executes the respective module installation or upgrade logic:

SF_ModulePersistence

Measure the performance of the Sitefinity CMS startup process

You can diagnose and measure the startup process by adding the following setting in the web.config file: 

With the help of this setting you get and output file displaying a tree view with the duration of the startup process. in addition, you get each each internal code block wrapper in the MethodPerformanceRegion method.

Keep in mind that you can also work with the Diagnostic Module, as it is integrated with the MethodPerformanceRegion.

Optimize website startup

To optimize startup times of your website, you can leverage the Microsoft .NET Compiler Platform, called Roslyn. Enabling Roslyn for your Sitefinity CMS application, you end up with improved startup and pre-compilation times. For more information, see Roslyn GitHub Overview.

In Sitefinity CMS, the Roslyn package is automatically added, as it is referred as a dependency.

As a result, the Roslyn compiler is enaled and optmize your site startup.

You can also use the Sitefinity CMS custom tool for precompiling pages. For more information, see For developers: Precompiler tool.

To learn how to keep the already compiled pages during startup, see Optimize development.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?