I am trying to implement file dependency caching in mvc3. As I am new to MVC, I browsed searched google but I didn’t get any help.
Can any of our guys help me out? or what is the work around for this?
I tried same as what we do in asp.net but I get error.
Code I tried:
public ActionResult About()
{
Cache.Insert("DropDownData", "", new System.Web.Caching.CacheDependency(Server.MapPath("~/testxml.xml")));
return View();
}
Error That i got:
An object reference is required for the non-static field, method, or property 'System.Web.Caching.Cache.Insert(string, object, System.Web.Caching.CacheDependency)
Try
System.Web.HttpRuntime.Cacheis the cache instance of your current application.