MSDN has quite a thorough topic on optimizing a Sharepoint Server for public facing site:
I would just like to add a few more points and share some thoughts on our experiences of customizing for performance in addition to this guide.
- Design your Sharepoint website with performance in mind. If you had it as an after thought and think "ooh, I'll just add performance bits at the end", then your options are far more limited. Not to mention the extra testing time you'll need. If you are in this situation, I'd say just stick with the caching options.
- Most visitors to a public facing site would be anonymous users - in fact, only a very small percentage of people may actually want to modify the website. So switch on anonymous login and start your optimizations there
- The easiest bits to set up are the caching options for Sharepoint. Sharepoint Server 2007 provides 3 means of caching:
- Page Output Caching - this is basically ASP.NET output caching, wrapped within Sharepoint. Follow the discussion in the article above will get you sorted. This has the biggest performance improvement for large amount of anonymous visitors.
- Object Caching - this is Sharepoint caching recently accessed object's properties (and lists) so that Sharepoint doesn't have to re-access them from Database.
- OK, these are the easy stuff - read the MSDN link if you need instructions to set this up.
- The article further discusses rendering core.js for only authenticated users. This takes a bit more effort to figure out.
- The idea behind the RegisterCoreWhenAuthenticatedControl is good, but proper implementation requires understanding of how ScriptLink works.
- A ScriptLink control can be specified on the page at one point, and subsequent ScriptLink.Register will add more scripts to be added at that point.
- A ScriptLink control will always register core.js unless it is in minimal mode
- To create a ScriptLink in minimal mode, create one in the markup without the name attribute (yes. this is really cryptic - here's why you need Reflector)
- <Sharepoint:ScriptLink runat="server"/>
- Follow by the control specified in the article:
- <NoCoreLoad:RegisterCoreWhenAuthenticatedControl runat="server"/>
- We took the idea a bit further and thought if we can get rid of the core.js file, how about get rid of the core.css file too, or in fact, anything. What we need is a wrapper container of some sort.
- There are two related classes for CssLink
- The CssRegistration class adds CSS files to the Sharepoint context
- The CssLink control renders all CSS files added to the Sharepoint context
- The CssLink can have additional DefaultUrl and AlternativeUrl specified, but it will always render the core.css file. There is no minimal mode
- The way we use is to create a wrapper container for CssLink
public class AuthenticatedPanel : Panel
protected override void Render(HtmlTextWriter writer)
public override void RenderBeginTag(HtmlTextWriter writer)
//disable rendering <div>
public override void RenderEndTag(HtmlTextWriter writer)
//disable rendering </div>
<CssRegistration runat="server ... />
<link rel="stylesheet" type="text/css" href="...path" />
- I like the AuthenticatedPanel that we created a lot more than the RegisterCoreWhenAuthenticatedControl - it is far more flexible in terms of the control we get on what gets rendered on the page at the end.