How to record the version information, detect version didn't update, customers through refresh the browser cache to get the latest version of the file,
CodePudding user response:
Directly into the localStorage, each entry page request API to match the local version is consistent, inconsistent just pull the latest content,
CodePudding user response:
The version following address can clear the cache, XXX. Js? V=1.01=& gt; XXX. Js? V=1.02
CodePudding user response:
In HTML tag set HTTP headers: header (" cache-control: no - Cache, must - revalidate ");
1) no - cache: mandatory cache from access to a new page on the server 2) no - store: cache in any environment don't save any page
2. At the back of the need to open the url add a random parameters: & lt; Script SRC="https://bbs.csdn.net/resources/Ext/localStorage.js? V=0601 "& gt; </script> Behind every request url parameter, is equivalent to request a different page, use this method to curve for national salvation, clear the cache,
CodePudding user response:
When entering for the first time, off the API interface to the back-end return version, determine whether consistent with the local version, consistent not operation, not agree, clear the local cache, the new version to replace into the cache, refresh again