Cache-bust Require.js scripts when developing locally
Developing JavaScript (or CoffeeScript) with Require.js can be very frustrating because the browser tends to cache previous versions of scripts until you clear the cache.
However, you can bust the cache by adding this configuration option to Require.js:
requirejs.config
urlArgs: new Date().getTime().toString()
That will cause all files to be loaded with a timestamped query string, thus bypassing the browser cache.
Written by Kenneth Falck
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Require.js
Authors
Related Tags
#require.js
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#