开发者

GET variable for css files?

I've noticed some sites when they link开发者_如何学Python to their css they pass what appears to be a GET variable in addition to the link, for example the http://html5boilerplate.com html template, ?v=2

<link rel="stylesheet" href="css/style.css?v=2">

Is this a flag for some server rewrite or something more?


Some sites may use it to route to specific css files, However, Without knowing the specific site you are referring to:

In the event that the css file changes, it provides a easy way to reset the browser cache on the clients computers. changing the v=2 to v=3.


This technique is used to load newly updated css files to users computer to replace the older one in cache. By simply changing the number from 2 to x, the browser will force loading the new css file. if this technique was not used, the user will have to clear his cache in order for the latest css file to take effect.


It is a GET parameter. The css file might be generated by php which may take this parameter into account and yes, it may also be used by other server side techniques to deliver a file from a different path.

The Scrum Meister's response is of course true as well ;-).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜