Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使 asp .net mvc 2 中的整个输出缓存无效?
AFAIK 这是不可能的。您只能通过使用[OutputCache]属性装饰它们来使可能已缓存的特定操作无效。
[OutputCache]
HttpResponse.RemoveOutputCacheItem(Url.Action("Index", "Products"));
虽然我不知道是否有办法在代码中做到这一点,但仍然回收工作进程可能会使服务器缓存无效。
如果这是真的,那么您甚至可以通过代码进行回收来在代码中执行此操作。