Answer the question
In order to leave comments, you need to log in
Is there any working way to bind the reset button with clearing the cache?
Now browsers have begun to cache more and more, it is not so easy for an ordinary user to show the current version of the site. Explaining where to click is a path to nowhere, I want to place a button that will refresh the page, as if ctrl + F5 were pressed.
I re-read all the answers on the topic on stackoverflow, but nothing works (I check in chrome).
location.reload(true);
var xhr = new XMLHttpRequest();
xhr.open("GET", uriOfCachedPage, true);
xhr.setRequestHeader("Cache-Control", "max-age=0");
xhr.send();
window.location.reload(true);
Answer the question
In order to leave comments, you need to log in
Change the name of the included files for each version of the site.
Or add a get parameter (eg /static/css/styles.css?v=2).
Files index.php>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question