0

I've created an Angular application. My application loads scripts from the server, but after the first run, as usual it takes scripts from the cache. I was using modern browsers but my tech leads want me to make it compatible with legacy browser as well. So, I'm using Internet Explorer 11 for now. I added some polyfills and got the application running:

/*******************************************
 * BROWSER POLYFILLS
 */

import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

But our requirement says that the application should fetch scripts from the server every single time the page loads. This is my network screenshot: enter image description here Obviously I cannot (or should not) say to our customers to manually disable their browser cache. Is there any way I can prevent this for IE 11 only or for all browsers from my code? Is it even doable? Please help.

1 Answer 1

4

You can use the command ng build --outputHashing=bundles. It creates the unique name of compiled files - with hashes. It solves the caching issue.

Documentation is here

And it does not matter which browser user uses

Sign up to request clarification or add additional context in comments.

1 Comment

Ok dmk, I did not get any answer better than yours. So, for now I'm accepting this. I'll come back to you in case some help is required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.