Optimizing Page/Widget edit time and page compile time for projects upgrading to Sitefinity 7.1

Optimizing Page/Widget edit time and page compile time for projects upgrading to Sitefinity 7.1

January 06, 2015 0 Comments

Prior to Sitefinity 7.1 one could experience an N+1 problem when opening a page for edit or when requesting it on the front-end for the first time. This was due to unnecessary database calls when Sitefinity is trying to construct the ASP controls on the requested page. As of 7.1 this issue has been resolved. Every user can now benefit from this optimization. The mechanism underneath consists of caching calculated metadata about hierarchical persistent objects(ChildProperties) in their parent (ControlProperty). Below are the scenarios when this metadata information is calculated:

  • Adding or updating a control through the page edit screen.
  • First time publishing a page / template after upgrading to 7.1

With this mechanism the system is slowly optimizing itself as editors make changes to the pages. However if 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.

Following is a code that does does all the calculation:

var task = new FixControlPropertiesTask();
task.WorkMode = FixControlPropertiesTask.Mode.FlagsOnly;
task.Id = Guid.NewGuid();
 
var manager = SchedulingManager.GetManager();
manager.AddTask(task);
manager.SaveChanges();

You can add the task to your project's Global.asax by subscribing to the Initialized event of the Bootstrapper, in a similar fashion to the  sample from our Sitefinity Documentation.

Martin Gebov

View all posts from Martin Gebov on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments
Comments are disabled in preview mode.
Topics
 
 
Latest Stories in
Your Inbox
Subscribe
More From Progress
d12fcc0bdb669b804e7f71198c9619a7
5 Questions Automakers Should Ask to Improve Asset Uptime
Download Whitepaper
 
SF_MQ_WCM
2018 Gartner Magic Quadrant Web Content Management (WCM)
Download Whitepaper
 
What-Serverless-Means-For-Enterprice-Apps-Kinvey
What Serverless Means for Enterprise Apps
Watch Webinar