How set the response header's Cache-Control in Sitecore?

Posted by user822211 on Stack Overflow See other posts from Stack Overflow or by user822211
Published on 2012-04-16T01:59:38Z Indexed on 2012/04/16 5:28 UTC
Read the original article Hit count: 199

Filed under:
|

By default, it looks like Sitecore does not cache pages. In web.config, set this

<setting name="DisableBrowserCaching" value="false"/>

and create pipeline processor

page.Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
page.Response.Cache.SetCacheability(HttpCacheability.Public); 

but it did not work, the repose head stays no-cache. By the way, I add the pipeline in the renderLayout, anyone knows? thanks!

© Stack Overflow or respective owner

Related posts about sitecore

Related posts about sitecore6