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
Post a Comment