Reference JS or CSS after adding? v= version Number Usage

Source: Internet
Author: User

[Plain]View PlainCopyprint?
  1. <span style= "FONT-SIZE:14PX;" >css and JS with parameters (shaped like. css?v= and. js?v= or. css?version= with. js?version=)
  2. <script type= "Text/javascript" src= "jb51.js?version=1.2.6″></script>
  3. <link rel= ' stylesheet ' href= ' base.css?version=2.3.3′type= ' text/css '/>
  4. There are two possible ways to use parameters:
  5. 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
  6. <script type= "Text/javascript" src= "Jb51.js" ></script>
  7. <link rel= ' stylesheet ' href= ' base.css ' type= ' text/css '/>
  8. But the browser will think that he is a version of the file!
  9. 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!
  10. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.