Home > Article > Web Front-end > Detailed explanation of why you need to add parameters after imported css or js files_jquery
css and js with parameters (in the form of .css?v= and .js?v=)
First, the script does not exist, but is dynamically generated by the server, so a version number is included to show the difference. That is, the above code is equivalent to
Second, the client will cache these css or js files, so every time after upgrading the js or css file and changing the version number, the client browser will re-download the new js or css file, flushing the cache. effect. You may sometimes find that if you modify the style or js, it will not change when refreshing, that is, the client caches the css or js file, so adding parameters is still beneficial!
The second situation is the most common, or both may exist at the same time.
The version number can be a random number, or an incremental value, a large version and a small version, or written according to the generation time of the script. For example, 20080727182553 is accurate to the second when the script is generated, and 2.3.3 is The way of big version and small version