title: Prevent RequireJS from Caching Required Scripts
body: <p>RequireJS seems to do something internally that caches required javascript files. If I make a change to one of the required files, I have to rename the file in order for the changes to be applied.  </p>
  
  <p>The common trick of appending a version number as a querystring param to the end of the filename does not work with requirejs <code>&lt;script src="jsfile.js?v2"&gt;&lt;/script&gt;</code> </p>
  
  <p>What I am looking for is a way to prevent this internal cacheing of RequireJS required scripts without having to rename my script files every time they are updated.</p>
  
  <p><strong>Cross-Platform Solution:</strong></p>
  
  <p>I am now using <code>urlArgs: "bust=" + (new Date()).getTime()</code> for automatic cache-busting during development and <code>urlArgs: "bust=v2"</code> for production where I increment the hard-coded version num after rolling out an updated required script.</p>
  
  <p><strong>Note:</strong></p>
  
  <p>@Dustin Getz mentioned in a recent answer that Chrome Developer Tools will drop breakpoints during debugging when Javascript files are continuously refreshed like this. One workaround  is to write <code>debugger;</code> in code to trigger a breakpoint in most Javascript debuggers.</p>
  
  <p><strong>Server-Specific Solutions:</strong></p>
  
  <p>For specific solutions that may work better for your server environment such as Node or Apache, see some of the answers below.</p>