requirejs-rails icon indicating copy to clipboard operation
requirejs-rails copied to clipboard

Provide dynamic "urlArgs" config for cache-busting

Open gmac opened this issue 11 years ago • 1 comments

With configuration params embedded as strings into the "requirejs.yml" file (which gets loaded once when the server starts), how do you provide a dynamic urlArgs: "bust=" + Date.now() configuration param for each time a page loads? Without that param, all script files are cached by the browser and do not reflect updates during development.

Seems like this should be really simple, so I may be missing something obvious here. Thanks!

gmac avatar Jun 28 '14 15:06 gmac

Looks like the answer is more about the RoR assets pipeline:

config.assets.cache_store = :null_store

P.S.: you can not use ruby code in .yml files without some tricks.

karen2k avatar Aug 08 '14 12:08 karen2k