1

For example,

<link rel="stylesheet" type="text/css" href="http://cdn.sstatic.net/stackoverflow/all.css?v=6fc726be6344">

This link tag of href with a query parameter

v=6fc726be6344

And I notice img and javascript tag also has this usage.

I want to know what's the meaning of this parameter?
The usage scenario and how to use it?

Magic
  • 1,182
  • 2
  • 18
  • 28

2 Answers2

2

It's to prevent the browser cache from storing those files. By adding a new query parameter (presuming the value of v changes on refresh) the browser thinks it's a new file and downloads it instead of reading from its cache.

Further reading:

Community
  • 1
  • 1
T. Junghans
  • 11,385
  • 7
  • 52
  • 75
1

It is probably just a version number that the server pays no attention to, but makes the URI unique for that version of the file that rarely has content changes. This allows very agressive cache control rules to be used for the file so browsers won't re-request it. When the file does change, the version number is changed and the browser ignores all previous cache rules (because the URI is different and cache rules only apply to the URI they are associated with).

However, it is just a piece of query string data, so it could be used for whatever purpose the author desires on the server and nobody without access to the server side code can see what that purpose is.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335