开发者

?ver= at the end of include - is there a technical effect?

开发者 https://www.devze.com 2023-01-31 08:39 出处:网络
I wonder what exactly the version nameing does? like jquery.js?ver=1.4.4 I mean if I use a cdn like this jquery/1.4.4/jquery.min.js?ver=1.4.4

I wonder what exactly the version nameing does?

like jquery.js?ver=1.4.4

I mean if I use a cdn like this jquery/1.4.4/jquery.min.js?ver=1.4.4 but another side has jquery/1.4.4/jquery.min.js?ver=1.3.2 in there, does this effect 开发者_运维百科caching?


Yes, by changing the =1.4.4 to something else, it forces the file to not be cached by the browser when a user comes back to the page. So if you upgraded to a new version of JQuery say 1.4.5, and you wanted to make sure that the client got the most current version of the file, you change the end of the url. This makes the browser think that it's a brand new file and forces it to download the new version.

(Having the version at the end helps you easily identify which version of the file you have, but that is totally aside from what is being asked :) ).

0

精彩评论

暂无评论...
验证码 换一张
取 消