Recalculate the metadata of control properties

Sitefinity CMS has optimizations for constructing the database queries in the following scenarios:

  • Opening a page for edit
  • Requesting a page on the front-end for the first time. 

Unnecessary database calls could lead to potential N+1 problems while trying to construct the ASP controls of the requested page. Sitefinity CMS resolves this issue by the introduction of a mechanism, which caches calculated metadata about hierarchical persistent objects (ChildProperties) in their parent (ControlProperty). The metadata information is calculated in the following scenarios:

  • Adding or updating a control through the page edit screen
  • First time publishing a page or template

Using this caching mechanism the system is slowly optimizing itself every time an editor makes changes to the pages. 

In cases, where you would like to manually optimize and force recalculation of all the metadata, you can launch a scheduled task to do this for you. This is convenient for large systems - an example scenario is when templates that are used by a large amount of pages are rarely changed and therefore the metadata is not calculated. To do this you can use the following code sample:

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

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to 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?