-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force browser to clear cache after upgrade #439
Comments
Apparently, a variation of this technique is still generally used, it's called "cache busting": https://javascript.plainenglish.io/what-is-cache-busting-55366b3ac022 We could integrate this in our minification process, naming the minified files |
jaragunde
added a commit
that referenced
this issue
May 2, 2022
This will enforce browsers to retrieve again the file when the hash changes, making sure users don't use old versions of the JS code. The minify script is changed in several ways, in addition to calculating and appending the hash to the file name: * To revert previous minification, we now use git reset --hard. It's dangerous but prevents the regexp logic from getting too wild. * We now loop through the php files for every js file, making the script much less efficient. Again, this is done to simplify regexp logic. * Explicitly delete source map files from previous minification, to prevent maps with different hashes to pile up.
jaragunde
added a commit
that referenced
this issue
May 4, 2022
This will enforce browsers to retrieve again the file when the hash changes, making sure users don't use old versions of the JS code. The minify script is changed in several ways, in addition to calculating and appending the hash to the file name: * To revert previous minification, we now use git reset --hard. It's dangerous but prevents the regexp logic from getting too wild. * We now loop through the php files for every js file, making the script much less efficient. Again, this is done to simplify regexp logic. * Explicitly delete source map files from previous minification, to prevent maps with different hashes to pile up.
jaragunde
added a commit
that referenced
this issue
May 9, 2022
We also tune a bit the `find` commands, to reduce the search scope.
anarute
pushed a commit
that referenced
this issue
May 23, 2022
We also tune a bit the `find` commands, to reduce the search scope.
Fixed with these commits, reviewed in PR #584 and #586:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we upgrade (or hotfix) the server, users often have trouble with cached files. There are methods to force that from the server, like appending a GET parameter to .js and .css requests with the version number, like:
ext.min.js?v=2.18
.The method is described here: https://stackoverflow.com/a/1922924
The text was updated successfully, but these errors were encountered: