How do I force Chrome to load a fresh copy of a page?
The other answer might be good for you own Chrome instance, but every other user will have the same problem. The problem is that Chrome needs to have must-revalidate
in the Cache-Control` header in order to re-check files to see if they need to be re-fetched.
To fix this once and for all for all users, include the following response header:
Cache-Control: must-validate
This tells Chrome to check with the server, and see if there is a newer file. If there is a newer file, it will receive it in the response. If not, it will receive a 304 response, and the assurance that the one in the cache is up to date.
If you do NOT set this header, then in the absence of any other settings that invalidate the file, Chrome will never check with the server to see if there is a newer version.
Here is a blog post that discusses the issue further.
There was a similar question posted here:
https://productforums.google.com/forum/#!topic/chrome/xR-6YAkcASQ
The answers are quite old so I don't know if it's been updated but back then it didn't look like chrome had an automated process (it probably still doesn't).
From the source above, two manual solutions are:
Press CTRL+SHIFT+DELETE and manually clear the cache each time; or
You will need to add a
'?random.number'
or"?date.code"
to every link each time a URL is pressed on your website.
For example, if 'myhomepage.html?272772'
is stored in the cache, then by generating a new random number eg. 'myhomepage.html?2474789'
, Google Chrome will be forced to look for a new copy.
Sorry if this is no help!
Edit: A potentially even better solution if you are developing using the Chrome Development Tools is found at this source:
https://stackoverflow.com/questions/5690269/disabling-chrome-cache-for-website-development
With a screenshot of the upvoted solution:
Hopefully this is an appropriate way to answer using another source.
Press Ctrl + F5 or Shift + F5 to load a fresh copy of the website.
Otherwise, you can switch off the caching feature from the developers tool. To do so:
- Visit the website and press F12.
- Go to networks tab and check the box "Disable cache".
This way you can always force the website to load fresh content and not cached files.