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 http://world.episerver.com/articles/items/relate-intranet-demo-site/
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?
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:http://sdk.episerver.com/library/cms6.1/html/T_EPiServer_PageBase.htm
I recall you get private if you are signed in or running it on localhost.
I overcame this by using this in my base page
var cache = System.Web.HttpContext.Current.Response.Cache;