tags:

views:

161

answers:

4

I have seen a web page source code containing the following css declaration at the header:

<link rel="stylesheet" href="/site_media/base.css?v=747" />

What is the use of "?v=747" at the end of this CSS declaration?

+4  A: 

It prevents browser caching from being an issue with new releases of the webapp

AgileJon
+13  A: 

To bypass the caching mechanism of the browser. If the file is updated, the version (I guess that's what v stands for) will be incremented and the browser will not use the cache, but download the file, since it is a different URL.

soulmerge
In fact, the browser will never cache that file, because GET requests with parameters are not cached by conforming HTTP implementations.
John Millikin
**Conforming**, being the important word. Two letters: **IE**
voyager
It is possible to configure Opera to cache GET requests. This is usually a bad idea, but there are some special situations where it can be useful.
Brian
+1  A: 

That's probably a version number. When the value for v changes, the browser will think it is a new file and fetch it (so that the file is not cached by the browser between different versions).

bdukes
+3  A: 

Typically the ? designates that following code is the query string for the url. Probably this site is running code to create a dynamic css file

RHicke
Can anyone explain the downvote? This was what I thought at first too. I'm not a web developer so the reason may be obvious to those more savvy than me.
Graeme Donaldson
I don't think that's what's happening in this case...but it's certainly *possible* that that's what's happening, and no one else has mentioned it, so +1.
Beska
+1, could very well be the case.
jeroen
I agree with jereon. I have had .jpeg files with parameters. ;)
Adam Paynter