Home > front end >  The browser cache clearing
The browser cache clearing

Time:09-17

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

CodePudding user response:

reference 1st floor jio's reply:
save directly to the localStorage, each entry page request API to match the local version is consistent, inconsistent just pull the latest content,

If you do not close your browser, log back in, localStorage is not updated

CodePudding user response:

reference xiaoxiang dream reply: 3/f
1. Use HTML tags 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,

Can, but I am a large, not a file to a file

CodePudding user response:

reference 4 floor front _ rookie response:
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, and then refresh

Inconsistency is clear the local cache only remind user manual removal?

CodePudding user response:

reference 5 floor weixin_42092625 reply:
Quote: refer to 1st floor jio's reply:
save directly to the localStorage, each entry page request API to match the local version is consistent, inconsistent just pull the latest content,

If you do not close your browser, log back in, localStorage is not updated.


How much time do you set a timer interval for a version information automatically updated version, or the upper right corner indicates a new version allows users to refresh myself,

CodePudding user response:

refer to 7th floor weixin_42092625 response:
Quote: refer to 4th floor front _ rookie response:
enter, 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, and then refresh

Inconsistency is clear the local cache only remind user manual removal?

Not only remind users, if your customers get user version, at the time of request interface returned to determine whether the same version, can be removed by request and response to local, put the new up again, equivalent to a request to intercept, such as your token is aging, request return to back a new token interface, you can remove the old replace new, a truth
  • Related