Using SharePoint Foundation 2010 and would like to enable output caching for certain pages for performance reasons. On SharePoint Server you can enable page output caching (it is actually ASP.NET output cache under the hood). Of course on SPF you don't get that.

So how can I enable output caching in SPF2010? In ASP.NET I would just add a page directive - something like <%@ OutputCache Duration="30" %>. SharePoint throws an error if this is in the page. Sounds like it needs to be done in code, perhaps override the page class? Any suggestions welcome.

1 Answer 1


SharePoint Foundation does not support output caching. You have to rely on IIS configuration or use the ASP.NET Cache objects in your code.

  • IIS caching works by file extension, so not so easy to choose which pages to cache. If some pages have forms or postback behaviour it is probably not an option.
    – Anonymous
    Commented Jun 22, 2010 at 13:27
  • Agreed. SP by default enables caching on some of the virtual directories containing static files. Commented Jun 22, 2010 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.