I see. The issue I have is I included a bit of code in the WidgetManager.js to attempt to deal with caching. Anytime I redeploy a WAB with custom widgets this cache issue rears its head and telling users to clear browser cache or use incognito window (both work) is not an acceptable solution.
I updated the _tryLoadWidgetConfig function in the WidgetManager.js with this,
_tryLoadWidgetConfig: function (setting) {
var def = new Deferred();
//need load config first, because the template may be use the config data
if (setting.config && lang.isObject(setting.config)) {
//if widget is configurated in the app config.json, the i18n has beed rocessed
def.resolve(setting.config);
return def;
} else if (setting.config) {
if (require.cache['url:' + setting.config]) {
def.resolve(json.parse(require.cache['url:' + setting.config]));
return def;
}
var configFile = utils.processUrlInAppConfig(setting.config);
// The widgetConfig filename is dependent on widget label,
// IE8 & IE9 do not encode automatically while attempt to request file.
var configFileArray = configFile.split('/');
configFileArray[configFileArray.length - 1] =
encodeURIComponent(configFileArray[configFileArray.length - 1]);
configFile = configFileArray.join('/');
//Append date to ensure you get the latest json file
configFile += "?currentVersion=" + Date.now();
return xhr(configFile, {
handleAs: "json",
headers: {
"X-Requested-With": null
}
});
} else {
return this._tryLoadResource(setting, 'config').then(function (config) {
//this property is used in map config plugin
setting.isDefaultConfig = true;
return config;
});
}
},
However, the WidgetManager.js file itself is being cached. So I hoped to apply something to whatever loaded this to force a new version to be loaded each time.