The new SharePoint 2010 site I stood up in my previous post will serve as the test case as we progress through our SharePoint page diet. The previous post “SharePoint 2010 Page Weight (Part 1)” also explained how to save the page and its contents locally. Here’s a breakdown of the page components:
• Core.css: 121 KB (SharePoint core styles)
• Home.htm: 99 KB (HTML of page)
• WebResource.axd: 21 KB (ASP.NET special handler for Web Resources)
• Etc… (the rest are under 20 KB)
All these SharePoint files come together to make a page which (including the files I did not mention) totals approximately 800 KB (yikes).
Our next step is to determine how we can reduce the total KB. The first big win is to keep in mind we are talking about a public facing website. This means we likely have alternate access mappings to at least two URL’s (one for the anonymous/forms auth users, and one for our content authors). The URL pinned to the anonymous users is the one we care about (in regard to SEO efforts anyway). Anonymous URL users will in most cases not be needing “core.js”. The core.js reference can be removed from your public (anonymous) users. This is handled in code and if you don’t already know how to do this, read this post by Patrick Rodgers on how to suppress core.js for anonymous users. We just reduced the size by 258 KB (a huge improvement). After removing the core.js, you should shift your focus to all images being used to determine if anything can be done to further trim some KB’s. Remember your code vs. content discipline – the higher this ratio is in favor of content (text) the better. This is the time to reconsider that fancy flash and other cosmetic features of the page that take up so much space.
After you have trimmed as many KB’s as possible, you’re ready to visit IIS and setup IIS compression. This step might involve modifying the meta base, so you should first make sure you have a recent IIS backup.