Search code examples
asp.net-mvccachingepiserver

EPiServer [ContentOutputCache] - Stop cache clear on Admin login


Recently I implemented [ContentOutputCache] for one of our sites and for the most part it's great. The cache seems to stop working when an Admin logs on to the CMS. This is probably by design. Is it at all possible to stop this happening? I want the cache to refresh only when something is published.


Solution

  • As I understand it, logged in administrators and editors will always see the NOT cached information. So when I want to test the cache I usually have two different browsers opened. In one I am logged in and in the other I'm not logged in. If you're logged in then you usually want to see the most up to date information and not the cached. But of course if another ordinary guest views the site at the same time as the editor/administrator, then the ordinary guest will still see the cached version (until an editor or an administrator saves some changes).