We are having some trouble with RequireJS not grabbing a fresh copy each time it is requested. We have used the following without success:
require.config({
urlArgs: "bust=" + (new Date()).getTime()
});
When viewing the network log, the page is loaded with the argument appended to the URL, however if the same page is called again, it doesn't appear in the network log at all, so it is coming from the cache somehow.
If anyone has any ideas, it would be greatly appreciated.
Thanks, Ryan.
This jsfiddle example shows urlArgs
working.
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
paths: {
"jquery": "http://code.jquery.com/jquery-1.9.1"
}
});
require(["module", "jquery"], function (module, $) {
console.log($.fn.jquery);
console.log(module, module.config());
});
With this output:
1.9.1
Object { id="_@r5", uri="./_@r5.js?bust=1365059426478", config=function()} Object {}
And the Net panel in Firebug shows a fresh version of jQuery downloaded each time.
Which browser(s) are you using?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.