[Plain]View PlainCopyprint?
- <span style= "FONT-SIZE:14PX;" >css and JS with parameters (shaped like. css?v= and. js?v= or. css?version= with. js?version=)
- <script type= "Text/javascript" src= "jb51.js?version=1.2.6″></script>
- <link rel= ' stylesheet ' href= ' base.css?version=2.3.3′type= ' text/css '/>
- There are two possible ways to use parameters:
- First, the script does not exist, but the server is dynamically generated, so with a version number, to show the difference. That is, the above code is equivalent to a file
- <script type= "Text/javascript" src= "Jb51.js" ></script>
- <link rel= ' stylesheet ' href= ' base.css ' type= ' text/css '/>
- But the browser will think that he is a version of the file!
- Second, the client will cache these CSS or JS files, so each time you upgrade the JS or CSS files, change the version number, the client browser will re-download the new JS or CSS files, the role of the brush cache. We may sometimes find that the change of style or JS, the time of the refresh is not changed, that is, the client cache css or JS files, so plus the parameters are good!
- The second situation is the most, and it is possible that both exist simultaneously. </span>
Reference JS or CSS after adding? v= version Number Usage