As seen in the code from http://html5boilerplate.com/ (ctrl+f “?v=1”)
What does ?v=1 do exactly? It’s tacked on to the external css and js urls.
As seen in the code from http://html5boilerplate.com/ (ctrl+f ?v=1) What does ?v=1 do exactly?
Share
It’s just a cache-breaking method, for example:
I can (via cache headers) tell you to cache it forever, then when I push a new version, it’s:
And your browser sees it as a new file it much fetch, and it can be cached forever as well, so basically you get the max cache benefit, and still force the client to re-fetch when a new version’s out there. If possible, this version would be the result of a build process, automatically updated when the file changes (or at least a new build’s, pushed, whatever the case may be).
As a real work example, look at the page you’re viewing now:
It’s a hash of the file…whenever it changes so does the hash on the end of the URL, and your browser will grab a new copy.