This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10518|Reply: 2

[JavaScript] CSS files and js files are followed by a question mark

[Copy link]
Posted on 12/21/2015 10:36:23 AM | | |

I often see css files and js files in the source code of some website pages with a question mark followed by a series of numbers or characters. I have also used this method, and it is very easy to use?, it has two functions: 1. As a version number, it makes it easy for you to remember and search; 2. As a modification tab, let the browser download the new file again. In fact, the question mark after the CSS file does not play a practical role, it can only be used as a suffix, if you use the question mark plus parameter method, you can add the version number and other information, such as the one used on Sina and Facebook:

http://xxx.xxx.cn/css/common/index.css?version=20101126145707  http://tjs.sjs.xxx.cn//static/js/top.js?version=20101126145707
You can clearly see when the CSS file was modified after the version, and when the CSS file is modified and uploaded to the server, you can also let the browser download the CSS file again, solving the problem of not flushing the cache. It's clear when you talk about it, right? A small detail that can add a lot of convenience to us.




Previous:C# Forms Pass Values Between Forms, the first form continuously passes values to the second form
Next:HttpListener-based web server
Posted on 12/21/2015 3:20:51 PM |
learned
 Landlord| Posted on 12/21/2015 4:25:37 PM |

Reduce the number of times the browser requests to load resources
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com