Prevent Cache-Control: private



So I have spent quite a few hours trying to work out why my website insits on adding Cache-Control: private to all requests.  For dynamic content I don't want it set to private so that my CDN will cache those pages.  If you bring up a bash window you can check the header using:

curl -kv -o /dev/null

All the Episerver demo sites come back with:

< HTTP/1.1 200 OK
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< ETag: ""
< Server: Microsoft-IIS/7.5

I have tried editing Episerver.config,  I have tried removing it and readding it using customheaders but the best I can get to is Cache-control:private, public.  Has anyone managed to find out where the private is being added?



Dec 13, 2015 14:23

Which version are you using? 

If you are on an older version and using Web Forms the source code for PageBase contains SetCachePolicy() and can be found here:

I recall you get private if you are signed in or running it on localhost.

Edited, Dec 16, 2015 8:50

Hi Johan,

I overcame this by using this in my base page

var cache = System.Web.HttpContext.Current.Response.Cache;
Edited, Jan 24, 2016 21:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.