I'm using output caching for some Index views because they contain a lot of data. I want to keep it specific for every user. because the view can differ depending on the roles.
[OutputCache(Duration = 3600, VaryByParam = "none", Location = OutputCacheLocation.Client)]
public ActionResult Index(string schooljaarparam) {
return View(_db.Lesplaatsens.Where(l => l.Schooljaar.Sch_Schooljaar == schooljaarparam).OrderBy(q => q.Lpl_Gemeente).ThenBy(q => q.Lpl_Instelling).ToList());
}
Now when someone creates a new item and returns to the Index view. How do I remove the cache of the Index page, so that the newly created item will show up in the list?
I thought this would be a common question but I did not find a solution yet.
I guess you need to use HttpResponse.RemoveOutputCacheItem()
but how do I find the route. And where can I see the current cached items in the debugger?