I use output caching for some kinds of indexes because they contain a lot of data. I want to keep it specific for each user. because the presentation may 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 to remove the index page cache so that the newly created item appears in the list?
I thought this would be a general question, but I have not yet found a solution.
I think 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?
source
share