Like the title says, Google Chrome refuses to load newer versions of a Javascript file.
I've tried:
- Ctrl + F5
- Dev Console > Network Tab > Disable Cache
- Disable Cache, Then With Dev Console Still Open Right Click Refresh > Empty Cache and Hard Reload
- Disable Cache, Then With Dev Console Still Open Ctrl + F5
- Chrome Settings > Manually Delete All Cache From Beginning Of Time, Then Ctrl + F5
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?