0

What does appending a query string to the end of a style sheet do? I often see:

some-stylesheet.css?ver=1.2.3

Thanks.

H. Ferrence
  • 7,906
  • 31
  • 98
  • 161
  • possible duplicate of [What does '?' do in a Css link?](http://stackoverflow.com/questions/438821/what-does-do-in-a-css-link) – BoltClock Jun 16 '11 at 19:51
  • Thanks @BoltClock...I am sure its a duplicate. I did a search before posting my Q but my search argument yielding nothing relevant – H. Ferrence Jun 16 '11 at 19:55
  • All answers (essentially) relate to caching. I plan to accept @BraedenP's answer because it was the first one posted. – H. Ferrence Jun 16 '11 at 19:57

5 Answers5

1

Usually people use it to prevent caching of the CSS file.

It could also be used by the server software (Apache, for example) to load a specific version of the CSS based on the string.

BraedenP
  • 7,125
  • 4
  • 33
  • 42
1

Adding a new query string forces the browser to reload the file instead of using a cached one.

jeroen
  • 91,079
  • 21
  • 114
  • 132
0

it helps with caching, if you append a query string the browser treats it like a new file, that way when you make changes they are shown immediately, not after you clear the browser cache

Trey
  • 5,480
  • 4
  • 23
  • 30
0

This is used in order to workaround browser caching while developing. If you increment that number in your HTML, browser will suppose it's a new file that he has not see ever before and will render the last version of it.

spliter
  • 12,321
  • 4
  • 33
  • 36
0

Problably they want to show you the newest version of the CSS, without caché of the browser. So using a parameter its solved.

Miguel G. Flores
  • 802
  • 7
  • 21