Pages

Search This Blog

Wednesday, August 31, 2016

Problem with Minimal Download Strategy in SharePoint 2013

Minimal download strategy is a feature in SharePoint 2013 which improves the user navigation experience faster also improve the performance of the SharePoint site by reducing the page load time. It can improve the performance by sending only differences (delta) data when user navigates from one page to another page in SharePoint, browsing navigation controls, speed and smooth transitions by updating the areas that can be changed.
When SharePoint site has Minimal Download Strategy is enabled then site has _layouts/15/start.aspx page in the URL which is followed by the #.
MDS formatted URL is like:
http://<URL>/_layouts/15/start.aspx#/SitePages/Home.aspx,

Problem

The big problem with MDS is that it only works well with the out-of-the-box stuff on a Team Site, or similar templates. As soon as we start to drop our own Web Parts, custom scripts or customization that has not been adapted for the Minimal Download Strategy you will not see any performance benefits, we will see a performance degradation in many cases – so we turn the MDS feature off.
One of the biggest problems is that the more and more customization in SharePoint involve JavaScript and so far I have not seen a single non-SharePoint native script that can handle MDS. Common approaches to this is to use the SharePoint _spBodyOnLoadFunctionNames.push() or the jQuery $(document).ready() {} method. These methods rely on the DOM events when the page loads, so it might work perfectly fine on our first page load when MDS is enabled, since we need to fetch the full page, but on subsequent page transitions the JavaScript will not fire. An MDS page transition does not fire any DOM document load events since it asynchronously partially updates the page.

To De-activate Minimal Download Strategy,
Click on Gear icon from top right corner of the SharePoint home page.
Click on Site Settings
Navigate to Site Actions -> Manage Site Features
Find Minimal Download Strategy from list of feature and Click on Deactivate button.

Once you de-activate the Minimal Download Strategy feature, it will remove _layouts/15/start.aspx from MDS formatted URL and your page URL become like:
http://<URL>/SitePages/Home.aspx .and it works like earlier normal SharePoint page URL.

No comments:

Post a Comment