Valid for Sitecore All Releases
  Caching Output of Layouts and Sublayouts
Prev Next

Whether the rendering is bound to a layout at design time or a placeholder at runtime, the rendering-level caching options allow caching the breadcrumb for a given URL, the login/logout link in the footer based on whether the user has authenticated, the main navigation based on exactly who has authenticated and other components by other criteria.

Chances that the same combination will be repeatedly requested are minor. For this reason caching of entire "pages" - the output of a layout - is disabled by default. This is controlled by the DisableBrowserCaching setting in the /web.config file.  When this value is true (the default), the following HTTP headers are inserted into each response:

Cache-Control: no-cache, no-store

Pragma: no-cache

This disables caching in browsers which access the page and any caching devices between Sitecore and the browser.  To enable caching of the output of entire layouts, which may be useful in certain configurations of caching servers:

  1. Set DisableBrowserCaching to false in /web.config.
  2. Adjust the appropriate OutputCache page directive in the layout(s) which should have output cached.
  3. Once DisableBrowserCaching is set to false, any OutputCache directive in a Sitecore layout gives the same result as it would in any .aspx page.  This directive is explained in detail by Microsoft Knowledgebase Article 308375 ( http://support.microsoft.com/default.aspx?scid=kb;en-us;323290&LN=ID ).

Prev Next