jcora jcora - 1 year ago 53
Javascript Question

Why isn't Google Chrome reloading my scripts?

So, I have a script called "engine", and after much headbashing and (futile) debugging, I've found out that GC simply isn't reloading it!

This is how I include it in the webpage (inside the


<script type="text/javascript" src="engine.js"></script>

When a put 10
's at the start of the script, it's like they aren't there. When I went to the "resources" tab in the GC console, I saw that no changes are being applied whatsoever to that script! Hlep? Would putting a
+ "?" + new Date()
at the end help?

Answer Source

It is possible that the script is cached so the old version is loading from cache. If you want to make sure you get a new version, you can force a browser reload, clear your browser cache or change the name of the script or put a different query parameter on the end of the filename.