Improving the Performance of your SharePoint sites
When starting to develop for SharePoint, most of the developers pay a lot of attention at the way they write their server-side code but in mos cases they don’t have a good understanding of how it can impact the traffic on the web and thus how it can impact the performance of the SharePoint site.
I’ve been working and stydying a lot around performance last months. I also read a lot of articles on MSDN, Technet, and a lot of blog posts scattered over the net. Recently I stumbled upon the book of Steve Souders “High Performance Web Sites”. It does not mention the word “SharePoint” once in it but a SharePoint site is also a web site and there is no reason at all why a SharePoint web site wouldn’t render its pages as fast as another web site.
This book is a must read for every SharePoint developer; not only for the SharePoint experts working on performance. It gives your a good insight of how the communication between client browser and server works and it explains in detail how HTTP request headers and HTTP response headers work. The book contains a lot of good advise on how to make this communication as fast as possible.
Based on this book, I decided to write a series of blog posts around High Performance SharePoint sites. I’ll discuss the different caching techniques that SharePoint uses, but also the techniques that Steve Souders explains in his book to reduce the number of HTTP requests and the size of the page and its resources that is sent back to the client browser in response to the requests.
There are many places where resources may be cached: on the server, on the client, on shared proxies, on network devices. ASP.NET uses the System.Web.HttpResponse.Cache object to manipulate the HTTP response headers that are used to control how resources on a page are cached.
Following Steve Souders less than 10 to 20% of the response time is spent getting the HTML document from the web server to the browser. If you want to reduce the response times of your web pages, you have to focus on the other 80 to 90% of the end user experience. 80% of the time is taken to display the page after the HTML has been downloaded.
Sometimes you want to cache the whole page, and sometimes you want only a small part of the page to be cached. But there are times that you want to cache the whole page except for a small part of it. Fortunately there are a number of techniques to do partial caching.
This series is based on SharePoint 2010 but most of the information can be easily applied on SharePoint 2007 and SharePoint 2013. A comparing study of SharePoint 2010 and SharePoint 2013 with respect to performance will follow after this series.
This series will contain the following posts:
- Part 1: How to track and analyse Web Page Performance
- Part 2: Caching possibilities in SharePoint
- Part 3: BLOB Caching
- Part 4: Output Caching
- Part 5: Object caching
- Part 6: ASP.NET Caching
- Part 7: SharePoint classes that use built-in caching techniques
- Part 8: Configure caching on IIS
- Part 9: How to analyse the HTTP request headers and HTTP response headers
- Part 10: How to reduce the number of HTTP requests
- Part 11: The Expires header and Cache-Control header
- Part 12: Remove the HTTP response headers generated by SharePoint and ASP.NET
- Part 13: The Etag header
- Part 14: Make JavaScript and CSS External
- Part 15: Only render the JavaScript files and CSS files you need
- Part 16: Remove duplicate scripts
- Part 17: Compress CSS files and JavaScript files
- Part 18: Minify JavaScript
- Part 19: Put Stylesheets at the top
- Part 20: Put JavaScripts at the bottom
- Part 21: Avoid CSS Expressions
- Part 22: Make Ajax Cacheable
- Part 23: Partial caching
- Part 24: Avoid Redirects
- Part 25: Reduce DNS Lookups
- Part 26: Use a static server to offload static resources like images, CSS files and JavaScript files
Sources:
- “High Performance Web Sites” – Steve Souders
- “SharePoint Server Caches Overview” – Microsoft Corporate
- SharePoint Caching Techniques – blog post Travis Lingenfelder
Hi Karine,
I would like to know more about Part 23:Partial caching, we have a webpart that is rendering content based on user’s identity, however we have to use output cache for performance reason. Coudl you please kindly let me know if there is any way o exclude a single webpart from output cache?
Thank you,
Cindy
Comment by Cindy | April 8, 2014 |
Hi Cindy, I still have to work through this material, sorry for the delay. There is no way to exclude a webpart from the output cache unless you manage caching programmatically per web part.
Comment by Karine Bosch | April 9, 2014 |
Excellent articles, but quite a few sections are incomplete beyond number 14. Do you plan to finish them ?
Comment by non | August 17, 2016 |
Yes I know, sorry for that. I changed jobs in the meantime and didn’t complete them. I cannot say for sure if I will invest in them in the near future.
Kind regards,
Karine Bosch
Comment by Karine Bosch | August 17, 2016 |