asp.net-mvc – 在system.web.optimization中自定义缓存清除

前端之家收集整理的这篇文章主要介绍了asp.net-mvc – 在system.web.optimization中自定义缓存清除前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在优化开启时从包中呈现样式时,您可以获得:
<link href="/Content/themes/base/css?v=UM624qf1uFt8dYtiIV9PCmYhsyeewBIwY4Ob0i8OdW81" rel="stylesheet" type="text/css" />

不幸的是,Android浏览器似乎没有load urls with query strings.有没有办法在System.Web.Optimization中自定义此字符串?

编辑:

My question is answered and I tried to detect android on user agent string and replace with a querystring less link to the stylesheet. Apparently the problem I had wasn’t because of the querystring,it was minified version of the webfont css that was causing it not to load the stylesheet completely in the Android stock browser.

Android stock browser 07001 which was a workaround for the ASP.NET minifier that 07002. I ended up putting the icon font css styles on it’s own “minified by hand” stylesheet.

解决方法

我们目前不支持自定义版本字符串在网址中的显示方式.

这是我们的codeplex网站上的问题的链接Url version issue

与此同时,如果您愿意在每次更改捆绑包时手动修改捆绑包路径,那么您可以避免使用帮助程序,只需要明确指向捆绑包的链接,每次捆绑包更改时都会更新:

<link href="/Content/themes/base/css" rel="stylesheet">

或者您可以通过bundle.Cacheability = HttpCacheability.NoCache在客户端上禁用缓存

猜你在找的asp.Net相关文章