How is it possible to invalidate the whole output cache in asp .net mvc 2?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
AFAIK this is not possible. You can only invalidate specific actions that might have been cached by decorating them with the [OutputCache]
attribute.
HttpResponse.RemoveOutputCacheItem(Url.Action("Index", "Products"));
回答2:
While I don't know if there is a way to do it in code, still recycling the worker process might invalidate the server cache.
If this is true then you might even do it in code by having code to do the recycling.