Expire Output Cache ASP.Net MVC

前端 未结 4 1904
走了就别回头了
走了就别回头了 2020-12-07 18:05

I am using the standard outputcache tag in my MVC app which works great but I need to force it to be dumped at certain times. How do I achieve this? The page that gets cac

4条回答
  •  孤街浪徒
    2020-12-07 18:52

    HttpResponse.RemoveOutputCacheItem() is probably the method you want to use. If you can figure out what name the actions are cached under, you can remove just the specific action (try setting a breakpoint or dumping all of the names of cached items to the screen)

    Otherwise, I'd iterate through the entire output cache and just clear every item.

提交回复
热议问题