I am using the Microsoft RedisOutputCacheProvider and have a very simple PartialView which I am caching based on the current user's SessionId via VaryByCustom
:
[OutputCache(VaryByCustom = "User", Duration = 3600)]
[ChildActionOnly]
public ActionResult Notifications()
{
return PartialView("Partials/Notifications");
}
This works great and caches as expected, however I wanted to manually expire this OutputCache from another page. I tried:
Response.RemoveOutputCacheItem("/Controller/Notifications");
But that doesn't seem to work. I also can't see any of the OutputCache keys via either my Redis store, or via my backend code, but I can definitely see the view being cached.