app_themes css 文件和版本号
我希望能够将版本号附加到位于我的 asp.net 网站的 app_themes 文件夹中的 css 文件中,以便对文件的修改将强制浏览器从服务器获取文件,而不是使用缓存。
css 输出路径看起来像 ~/app_themes/blue/blue.css?v=1234
知道如何在无需手动编辑文件名的情况下完成它吗?
I would like to be able to have a version number appended to a css file located in my app_themes folder in my asp.net website so that modification to the file would force the browser to get the file from the server instead of using the one in the cache.
the css output path would look like ~/app_themes/blue/blue.css?v=1234
Any idea how it can be done without having to manually edit the filename?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此处提供了更详细的解决方案:
将url参数添加到asp主题文件夹中的css文件
A more detailed solution is available here:
Add url parameter to css file in asp themes folder
我会尝试这样的方法
对所有 CSS 引用执行此操作,然后当您部署到实时站点时,您只需更改常量 VERSION_NUM
I'd try something like this
Do that to all your CSS references, then when you make a deployment to your live site, you can just change the constant VERSION_NUM
通过以下概念在 .net 应用程序中实现 css 版本控制将是简单且最佳的概念
IT would be easy and best concept to implement css versioning in .net application by below concept