Like the title says, Google Chrome refuses to load newer versions of a Javascript file.
I've tried:
Basically everything listed here: Chrome WON'T clear cache... ctrl + F5 doesn't seem to work either
None of this worked. The sources panel still shows that the old Javascript file was being loaded. The absolutely mind-boggling thing is that when I right click the file in the sources panel and then select open in new tab, the updated file opens in a new tab, but then refreshing the page still brings up the old file in the sources panel of dev console.
The only thing that has gotten Chrome to work for me is to manually append ? and a random number at the end of the file name. That seems to force Chrome to actually load the new file. As of now, I've been using PHP to add a
<script type="text/javascript" src="file.js<?php echo '?' . rand(); ?>"></script>
in order to get anything to load correctly in Chrome, but this seems like a terrible solution.
My question is, How do I get Chrome to actually reload Javascript files from the server instead of the cache?
Here are some ways you can try to fix your caching problem, in order of escalation: Try holding down the Shift key while pressing the Refresh button. Close your browser and re-open it (make sure you are NOT on the cached page) and delete your temporary Internet files (clear your cache).
You might notice that when you clear cache, it comes back eventually. This is normal; over time, apps will build up cache again based on your usage. Because cache is useful, you shouldn't worry when an app builds up cached files. Clearing cache shouldn't log you out of apps or cause any other major changes.
When you're in Google Chrome, click on View, then select Developer, then Developer Tools. Alternatively, you can right click on a page in Chrome, then click Inspect. Click on the Network tab, then check the box to Disable cache. You can then close out of Developer Tools.
Have you tried completely wiping your cache ?
C:\Users\yourusername\AppData\Local\Google\Chrome\User Data\Default\Cache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With