The cache has been set on the server, but the version is released. If JSCSS is modified, no version is added. If the client browser does not forcibly clear all the caches, the old cache resources are still used. How can I solve the static resource cache problem? Is YII2 using this idea? JSC is detected every time... the cache has been set on the server, but the version is released. If JavaScript CSS is modified, no version is added. If the browser on the client does not forcibly clear all the caches, the old cache resources are still used. How can I solve the static resource cache problem?
Is YII2 using this idea? Is the last modification time of the js css file detected every time?
If the file is the same as the cached file, do not regenerate it. Otherwise, the cached js css file will be regenerated?
Reply content:
The cache has been set on the server, but the version is released. If JavaScript CSS is modified, no version is added. If the browser on the client does not forcibly clear all the caches, the old cache resources are still used. How can I solve the static resource cache problem?
Is YII2 using this idea? Is the last modification time of the js css file detected every time?
If the file is the same as the cached file, do not regenerate it. Otherwise, the cached js css file will be regenerated?
The yii solution is very good. It is generally solved by adding a version number.
Let's look at the implementation of laravel. In the elixir section. The principle is to read a ing file. This file is generated by gulp.
Use gulp-rev-hash to distinguish by hash.
You can use fis3. to differentiate resource files with md5 suffixes
Md5 production abstract, used as the suffix of the file .. Gulp, grunt, or webpack can be solved in a corresponding way.
1. Version Number
2. hash naming
I suggest you look at this
Https://www.zhihu.com/question/20790576
Recommended for solutions ~ However, RoR and Django have their own solutions. yii2 is not clear.