加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 04:03:32 所属栏目:asp.Net 来源:网络整理
导读:在优化开启时从包中呈现样式时,您可以获得: link href="/Content/themes/base/css?v=UM624qf1uFt8dYtiIV9PCmYhsyeewBIwY4Ob0i8OdW81" rel="stylesheet" type="text/css" / 不幸的是,Android浏览器似乎没有load urls with query strings.有没有办法在System.
在优化开启时从包中呈现样式时,您可以获得:
<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在客户端上禁用缓存

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读