The only way to make the update available to all users is to edit the webpart and add a timestamp to the JSLink file. For example you can add ?timestamp=2016122200.
Also, to avoid this problem, I use a short static code in the JSLink file that will call another JS file where all the stuff I modify often will written. By doing it I'm able to do all the changes I want and it will be immediatly spread to the world.
Here is the code I use into the JSLink file:
// loadExt permits to load JS and CSS files
// https://gist.github.com/Aymkdn/98acfbb46fbe7c1f00cdd3c753520ea8
function loadExt(e,t){var s=this;s.files=e,s.js=[],s.head=document.getElementsByTagName("head")[0],s.after=t||function(){},s.loadStyle=function(e){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,s.head.appendChild(t)},s.loadScript=function(e){var t=document.createElement("script");t.type="text/javascript",t.src=s.js[e];var a=function(){++e<s.js.length?s.loadScript(e):s.after()};t.onload=function(){a()},s.head.appendChild(t)};for(var a=0;a<s.files.length;a++)/\.js$|\.js\?/.test(s.files[a])&&s.js.push(s.files[a]),/\.css$|\.css\?/.test(s.files[a])&&s.loadStyle(s.files[a]);s.js.length>0?s.loadScript(0):s.after()}
(function() {
// onLoad() is called when all the fields in the form have been proceed
function onLoad(ctx) {
// if you need jQuery for example
loadExt([
"jquery-1.12.4.min.js"
], function() {
// and to avoid the cache I put all the JS code into the Form_loaded.js file
$.getScript('Form_loaded.js', function() {
// the function onLoadReady() must be into the Form_loaded.js file
onLoadReady(ctx)
});
}
});
}
// do some actions as soon as the fields are shown
var loadAfterForm = {
Templates: {
OnPostRender:function(ctx) {
// only trigger when everything is loaded
// --> ctx.ListData.Items[0] all the fields
if (ctx.ListSchema.Field[0].Name === "Attachments") {
onLoad(ctx)
}
}
}
}
// don't do it when editing the page
if (GetUrlKeyValue("PageView") !== "Shared" && GetUrlKeyValue("DisplayMode") !== "Design") SPClientTemplates.TemplateManager.RegisterTemplateOverrides(loadAfterForm);
})();
So Form_loaded.js is called without this cache issue! Very useful :-)