MVC4脚本捆绑缓存问题 [英] MVC4 Script Bundles Caching issue

查看:253
本文介绍了MVC4脚本捆绑缓存问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个MVS应用程序,我们使用的是包类(不这样做微小)捆绑的JavaScript code。

We have an MVS application where we are bundling the javascript code using Bundle class ( don't do minification).

捆绑只是工作正常,但是当我们运行应用程序,缓存值设置为的Cache-Control:no-cache的并在同一时间我们每次刷新请求,总是有一个页面200确定。这意味着JS是没有得到的,即使没有被更改的客户端缓存。

Bundling just works fine, but when we run the application, Cache value is set to Cache-Control:no-cache and at the same time every time we refresh the page the request always has a 200 OK. This means the js is not getting cached on client even though nothing was changed.

也就是有没有办法验证,如果捆绑的JS动态或服务器缓存获得它建?

Also is there a way to verify if the bundled js is built dynamically or getting it from server cache?

感谢

推荐答案

这个问题似乎是与Microsoft.AspNet.Web.Optimization的NuGet包。降级版本1.3.0,从1.1.0到后,一切似乎是工作的罚款。

The problem appears to be with the Microsoft.AspNet.Web.Optimization NuGet package. After downgrading the version from 1.3.0 to 1.1.0, everything seems to be working fine.

链接到博客文章上codePLEX里面提到了同样的问题

这篇关于MVC4脚本捆绑缓存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆