I'm working on JavaScript for a site, developing with Firefox, and when I refresh the page, I don't see my changes. The JavaScript file is in an external file. I reloaded and refreshed the page several times, but the old JavaScript file was still cached. Finally, I loaded the JavaScript page in the browser directly, saw the old script, hit 'reload', and saw my changes.
How can I clear cached external JavaScript files? I'll need to know this also when I tell the client that the changes are made, so that they aren't seeing the old cached functionality.
As long as the app hasn't changed, the tag will stay the same and therefore the query string will also. The browser should cache the JS and not do a network request at all because the expire date is far future. Each time the app is updated, that query string will change and the browser should download it.
I use Ctrl + F5 . It's like a force refresh. This refreshes the page including re-downloading any referenced JavaScript files or CSS files even if they were cached.
1 Right-click on the Screen. 2 Click on Inspect. This will open dev tools. 3 Then right click on the Refresh like icon and then click on Empty Cache and Hard Reload for clearing all cache and hard reload for loading fresh content along with static content like CSS, js, images, etc.
To bypass cache for one time in Firefox:
Some web hosting services do cache the page server-side. When bypassing cache, web browsers will send a header to tell the server that it should not respond with the cached data.
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