In MVC 3 I was outputcaching a JsonResult like this:
[OutputCache(Location = OutputCacheLocation.Server, Duration = 21600, VaryByParam = "None", VaryByCustom = "tenant")]
public JsonResult NotifyTasks(int id) {
return Json(new {pending = 5}, JsonRequestBehavior.AllowGet);
}
}
The URL to get the JSON was:
http://localhost/foo/notifytasks/1
At times I invalidate the cache pages with a simple
HttpResponse.RemoveOutputCacheItem("foo/notifytasks");
The method signature has changed and RemoveOutputCacheItem no longer works. The URL now has the querystring ?status=Status1 appended and this broke RemoveOutputCacheItem.
[OutputCache(Location = OutputCacheLocation.Server, Duration = 21600, VaryByParam = "None", VaryByCustom = "tenant")]
public JsonResult NotifyTasks(int id, string status) {
return Json(new {pending = 5}, JsonRequestBehavior.AllowGet);
}
http://localhost/foo/notifytasks/1?status=Status1
How do I get RemoveOutputCacheItem to work with an appended querystring?