先进的缓存:是否所有的浏览器都支持URL参数的更新? [英] Aggressive Caching: Do All Browsers Support URL Parameter for Updating?

查看:303
本文介绍了先进的缓存:是否所有的浏览器都支持URL参数的更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在积极缓存CSS和其他文件,可以强制用户通过重命名文件和链接到新的副本(更新样式表的最新版本如 style.123.css 重命名为 style.124.css )。经常使用的,而不是重命名文件不同的方法是通过一个URL参数(例如,的style.css?版本= 123 这是后来改的的style.css?版本= 124 )。

When aggressively caching CSS and other files, you can force the user to update to the latest version of the stylesheet by renaming the file and linking to the new copy (eg, style.123.css renamed to style.124.css). A different method often used instead of renaming the file is to pass a URL parameter, (eg, style.css?ver=123 which is later changed to style.css?ver=124).

是否所有的浏览器都支持下载样式表的新副本后一种方法?有什么缺点,使用URL参数过重命名文件?​​

Do all browsers support the latter method for downloading a new copy of the stylesheet? Are there any disadvantages to using the URL parameter over renaming the file?

推荐答案

进一步研究后,事实证明,一些代理缓存服务将与URL查询字符串不缓存文件。这是否是真的为某些Web浏览器,我不知道。

After further research, it turns out that some proxy caching services will not cache files with query strings in the URL. Whether this is true for some web browsers, I don't know.

因此​​,这似乎是使用查询字符串来更新积极缓存文件的唯一的主要缺点 - 他们可能不会在缓存所有

So this seems to be the only major disadvantage of using query strings to update aggressively cached files - they may not cache at all.

这篇关于先进的缓存:是否所有的浏览器都支持URL参数的更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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