Developing SharePoint web sites is a though hob, but writing performing SharePoint web sites is even tougher.
Without caching, the page and its data is always retrieved from the content database. Although this ensures that all users always see the most up-to-date data, it has the downside of requiring constant data traffic between SQL Server and the web front-end servers slowing down the loading of the page to the client browser.
There are different techniques that can be applied to improve the performance of a SharePoint page:
- Minimizing round trips to the content database on every call
- Reduce permission checks on the content database
- Pre-compiling user controls and pages
- Saving the output HTML of pages
- Reusing database connections and requests when possible
In this part and the 4 parts that follow, I will highlight how you can improve performance of a publishing site, making use of the different caching techniques that SharePoint offers out of the box.
SharePoint has its own caches that run on the web front ends. Caching is the technique of storing local copies of data on each web front-end limiting the round trips to the SQL Server database and ensuring quicker responses to serve the user requests.
There are 4 different types of caching:
|Type of caching||What is cached?||Where is it cached?|
|Output Cache||Caches the publishing (.aspx) pages||In memory of the WFE|
|Object Cache||Caches data objects||In memory of the WFE|
The IIS Cache is a special case and is in general not considered as a cache used by SharePoint because it only concerns browser caching on the client. All other caches also allow browser caching. But I always tend to mention it because you can configure IIS Caching on IIS level.
The SharePoint Server caches require additional system resources to store and maintain content and indexes.
Caching can be achieved by configuring settings on web application level and on site collection level. Many developers consider the configuration of settings – and in this case caching settings – as an infrastructure job but in my opinion a good SharePoint developer needs to understand the different possibilities. Additionally there are different coding techniques to obtain data caching. Some of the classes of the SharePoint Object model use build-in caching techniques, but you can also implement your own caching mechanism. The developer side of caching will not be detailed in this blog post but will be explained in the post “Part 7: SharePoint classes that use built-in caching techniques”.
No comments yet.