[Mono-aspnet-list] How to use AddCacheItemDependency

Andrus kobruleht2 at hot.ee
Tue Oct 16 11:34:03 UTC 2012


AddCacheItemDependency is used to clear OutputCache in Mono Apache MVC2 application using code below.
This is described in  http://stackoverflow.com/questions/11585/clearing-page-cache-in-asp-net
        
In Mono, OutputCache is not cleared.
Looking into source code in GitHub shows that AddCacheItemDependency  is not implemented in Mono.
How to fix this so that OutputCache can cleared ?

Andrus.

[OutputCache(Duration = 3600, VaryByParam = "none")]
public ActionResult Index()
{
  HttpContext.Current.Response.AddCacheItemDependency("Pages");
  return View();
}

public ActionResult Refresh()
{
HttpRuntime.Cache.Insert( "Pages", DateTime.Now);
}

in Global.asax.cs:

protected void Application_Start()
{
HttpRuntime.Cache.Insert( "Pages", DateTime.Now);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20121016/18268e53/attachment.html>


More information about the Mono-aspnet-list mailing list