4

According to Sitecore config, if we set DisableBrowserCaching to true, then the Cache-control header value would change to no-cache, no-store. In my case, this is not happening and it always shows Private as default value.

Has anyone faced similar issue? Any help on this would really be appreciated ?

<!--
DISABLE BROWSER CACHING
        If true, all pages will have:
          Cache-Control: no-cache, no-store
          Pragma: no-cache
        in the http header

-->
<setting name="DisableBrowserCaching" value="true"/>
5
  • 2
    Do you see this for all items or only items in Media library? In case Media Library only then you will have to set MediaResponse.Cacheability to public
    – Jeroen
    Commented Nov 6, 2018 at 15:07
  • @JTC what version of Sitecore are you using? If it's 8.1 Update 2 Support confirmed that caching not being set correctly is a bug with 8.1 Update 2 MVC (reference number #116813). I implemented a fix for this with some guidance from support and it sets the cache to "Cache-Control: no-cache, no-store Pragma: no-cache" when DisableBrowserCaching is true. I can share the code if you need it. Commented Nov 6, 2018 at 22:31
  • @AdamSeabridge - You are right, I came across the same issue what you mentioned (reference number #116813). I did check with sitecore support to confirm this . The setting of Cache-control at the IIS level would not work in my case as i have CDN set up for media items . I was told to go with custom processor that is in progress. it would be grateful if have any code for custom processor . Please share
    – JTC
    Commented Nov 8, 2018 at 6:47
  • i was able to achieve this by writing the custom processor
    – JTC
    Commented Nov 8, 2018 at 11:05
  • Sorry for the delay @JTC, It's been a busy week! I've blogged about this now and put my answer below. Commented Nov 9, 2018 at 19:11

1 Answer 1

3

This is confirmed as a bug in Sitecore 8.1 update 2 (and I believe up to 8.2 update 5) by Sitecore Support (reference number #116813).

It requires an custom pipeline to patched in to resolve the issue. I've blogged about how to fix this here:

http://www.flux-digital.com/blog/disabling-private-cache-sitecore-pages-not-working-sitecore-8-1-8-2/

I don't think there is an official patch/fix for this still.

2
  • Thanks for this. I have addressed this by writing a custom processor with the same implementation what sitecore provided in sitecore 9.X and blogged about this in this link jbathecoder.wordpress.com/2018/11/08/…
    – JTC
    Commented Nov 14, 2018 at 9:41
  • No worries. Glad you got it sorted. good to see this is fixed in 9.x Commented Nov 14, 2018 at 9:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.