5

Why do some people write this:

shop/js/uds-jsonp.js?ver=2.70

instead of

shop/js/uds-jsonp.js

I have checked the resource with ?ver=2.70 or without ?ver=2.70 and I did not see any differences.

Richard Erickson
  • 2,568
  • 8
  • 26
  • 39
  • 1
    It's to avoid problems with the browser keeping a cached version of the script. Cache lookups are based on the complete URL, so if the version number changes the browser will not find the script in its cache. – Pointy Jul 31 '15 at 12:48
  • Possible duplicate of [what is style.css?ver=1 tag?](http://stackoverflow.com/questions/1614429/what-is-style-cssver-1-tag) – Anthony Geoghegan Aug 19 '16 at 11:28

1 Answers1

5

This is for cache busting, if you change the version (the ver URI parameter) when a user loads the page uds-jsonp.js will be reloaded and not loaded from cache, ensuring the latest version is served.

Community
  • 1
  • 1
dekajoo
  • 2,024
  • 1
  • 25
  • 36