我一直在考虑安装CacheCow ( https://github.com/aliostad/CacheCow ),只需应用nuget包,然后添加:
GlobalConfiguration.Configuration.MessageHandlers.Add(new CacheCow.Server.CachingHandler(GlobalConfiguration.Configuration));添加到我的全局配置文件。一旦我这样做了,我的网格都不会正确刷新,无论新数据是否可用,它们都会缓存旧值。我已经使用了头部:
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public JsonResult _GetProjectList([DataSourceRequest] DataSourceRequest request)
{
return Json(data.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
}用于顶部的outputcache,但这似乎没有帮助。有没有人有使用cachecow和kendo数据源的经验,以及如何让它们相互协作?
发布于 2015-05-29 22:46:31
您可以尝试将此作为一种解决方案。
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
public JsonResult _GetProjectList([DataSourceRequest] DataSourceRequest request)
{
//force the response to not cache the results.
this.Response.Cache.SetCacheability(HttpCacheability.NoCache);
//some code here......
return Json(data.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
}不久前,当我注意到一些Kendo小部件没有正确更新它们的数据源时,我不得不这么做。(当我在浏览器的开发工具中关闭浏览器缓存时,它们确实更新了)。
虽然我还没有使用过这个包,但希望它能为你工作。
https://stackoverflow.com/questions/30530584
复制相似问题