Wednesday 23 March 2011

SharePoint 2010 - Improve the Public Website Performance

This is important for those who working on public SharePoint site the performance impact of default templates, such as default.master and nightdaddy.master masterpage page file.

Out of the box the SharePoint inject a lot of javascript files and controls for various purpose, like page UI functionalities or backward compatible. E.g corev4.js and SharePointWebControls:UIVerisonedContent.

These additional JS files or components were generated huge amount of overhead when loading a page, see the comparison at below.



That is about 4 times smaller (22.36KB and 80.25KB) than out-of-the-box template, some more the customized template (removed edit scripts and control) was consisted more images and content query webpart compare to standard but empty page.

So my recommendation for public website when using the SharePoint.
  • Remove the SharePoint script files from masterpage if you not need them, such as <SharePoint:ScriptLink language="javascript" name="core.js" defer="true" runat="server"/>. Only inject those scripts when in edit mode by using PublishingWebControls:EditModePanel.
  • Remove SharePoint editing stylesheets, such as speditingstyle.css, edit-mode-21.css, webtagging.css, wpeditmodev4.css and forms.css. Inject them by using the Editmodepanel.
  • Remove the controls from masterpage or page layouts, not to hide or disable them. As system still generate but hide them by style.