I'm using the app engine locally, and sometimes the JS files are being cached between page refreshes, and it drives me crazy because I don't know if there's a bug in the javascript code I'm trying to write, or if the cache is acting up.
How do I completely disable cache for *.js files? Or maybe the question is, how to have it be smart, like based on last-modified date.
Thanks!
UPDATE- So it turns out Chrome Dev (for mac at least) has caching issues, going back to Chrome Beta fixes all this. The answers have still been helpful though, thanks
A common practice used by the major sites is to cache documents forever but include a unique identifier based on the release version or date into the url for the .js or .css call. For example:
<script type="text/javascript" src="static/util.js?version=20100310"></script>
This way you get optimum caching as well as always up to date files. The only trick is to figure out how to include an up to date version number in your url, which you can automate based on your deployment environment.
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