0

I use [OutputCacheAttribute] to cache some actions. Everything works fine. Let's say I set its Duration property to 1 hour. But I want to be able to clear cached values. Is it possible?

2
  • This has been asked and answered already, see stackoverflow.com/questions/11585/… Commented Aug 19, 2011 at 5:22
  • The question you referred to page caching. It doesn't work for child actions Commented Aug 19, 2011 at 6:39

1 Answer 1

1

After looking at [OutputCacheAttribute] source code, it seems that the only possible solution is to implement a new class derived from MemoryCache and set it OutputCacheAttribute.ChildActionCache property. This class will be use some custom prefix for all cached keys, so I'll be quite easy to find them (and then remove from cache).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.