Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ModelCacheManager Class

Manages the Application Model cache designed to improve the startup speed and performance.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public class ModelCacheManager

Remarks

You can customize the ModelCacheManager behavior using the following static fields.

Field Description
ModelCacheManager.UseMultithreadedLoading Enables multi-thread loading of the Application Model cache.
ModelCacheManager.SkipEmptyNodes Enables skipping empty nodes when creating and loading the Application Model cache.

Setting both these fields to true may reduce the application startup time when the Application Model cache is enabled (see XafApplication.EnableModelCache). As these fields are static, you can access them from any code location that is executed before the Application Model cache is accessed:

  • in the constructor of your platform-agnostic module located in the Module.cs (Module.vb) file;
  • in the constructor of your application located in the WinApplication.cs (WinApplication.vb) or WebApplication.cs (WebApplication.vb) file;
  • in the Main method of the WinForms application located in the Program.cs (Program.vb) file, before the WinApplication.Start call;
  • in the Application_Start method of the ASP.NET application located in the Global.asax.cs (Global.asax.vb) file, before the WebApplication.Start call.

Important

If SkipEmptyNodes is enabled and there is a custom Node Generator or Generator Updater which can create empty nodes, these nodes will not be cached and will not be restored from cache. You will need to override the UpdateCachedNodes method of your Node Generator, or UpdateCachedNode of your Generator Updater to recreate these empty nodes when the Application Model is being loaded from the cache.

For deeper customizations, inherit this class, handle the XafApplication.CreateCustomModelCacheManager event and pass your custom ModelCacheManager descendant to the CreateCustomModelCacheManagerEventArgs.ModelCacheManager parameter. An example is provided in the XafApplication.CreateCustomModelCacheManager event description.

Inheritance

Object
ModelCacheManager
See Also