iis - How to avoid asking the clients to clear browser cache for the latest Javascript changes? -


a client report bug in our js-heavy app, fixed it, client's browser still using cached copy. happens lot, , asking our clients flush browser cache seems low-tech , troublesome.

we aware of ?ver=xxx workaround, use requirejs it's not easy apply such hack.

would http cache control work? however, noticed iis not pick js file changes right away , http header (last modified) not reflect latest changes.

would etag work better? better or worse last modified on iis?

any other solutions? thanks

requirejs has cache busting property can use -:

require.config({     urlargs: "bust=" + (new date()).gettime() }); 

edit -: however, ian pointed out below, in documents recommended not use way production code.

everytime push new commit production maybe can instead add specific version number.

require.config({         urlargs: "ver=1.1.1"     }); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -