2

I am using the standard outputcache tag in my MVC app. i have this

   [OutputCache( Duration =600, VaryByParam = "none", Location = OutputCacheLocation.Server)]

the thing is that i want to force the removal of entire collection of cache from my website with the single click of the button in asp.net mvc. how can i do that? i have tried many examples in the stackoverflow site unsuccessfully.

2) where can i find the collection of outputcache in asp.net mvc c#.

1
  • I'm not sure if MVC uses this, but in .NET 4.0, you can build a custom output cache provider; therefore, you can control where the cache is stored and remove it: msdn.microsoft.com/en-us/magazine/gg650661.aspx Commented Dec 20, 2011 at 16:30

1 Answer 1

1

You could use the Response.RemoveOutputCacheItem method to remove the cached output of the given page by providing the url that was used to serve the cached action.

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

2 Comments

ok so this is not possible by any means Response.RemoveOutputCacheItem("/")?
@mazharkaunainbaig, no, it is not possible.

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.