问题
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.
来源:https://stackoverflow.com/questions/4782569/invalidate-the-whole-output-cache-in-asp-net-mvc-2