For html, it will be compared with the server-side file according to the last modified, and then decide whether to use local cache, so if the html changes, the client will update immediately. But if js is modified, sometimes the client will not be updated. Isn't js judged based on last modified?
After updating, you must add a change parameter (such as v=11) after the js path to update the client.
It’s different.
The document itself is retrieved from the Cache directory based on Last-Modified.
There are some things that Last-Modified cannot solve. For example, some files will be modified periodically, but the content may not change every time.
Etag in HTTP1.1 can solve this problem.
For Css files, Javascript files, images, etc., a unique parameter is used, such as the v=11 you mentioned.
If you want to know more, you can take a look at the HTTP protocol for Last-Modified and the definition of ETag
I saw someone in our company writing code just add a change parameter at the end. It is said to prevent caching. I don’t know how to ask for an expert
I saw someone in our company writing code just add a change parameter at the end. One change parameter is said to be to prevent caching. I don’t know if I’m asking for an expert
. It’s equivalent to my V=11. Some pictures still need to be cached. In this case, without caching, the performance will be poor.