Let's say my JS (call it default.js which relies on some lib called A.js) dynamically loads some A.js file via jquery first, and then it loads A.js the second time by adding the < script > tag to the html file. (Don't ask me why I do it. It's just a hypothetical situation I create to simplify the question).
It appears that on IE (both IE 9 and IE 11), A.js is actually loaded twice instead of A.js being cached to avoid second network request. I can see this happening from the network trace using IE embedded dev tool. When I do the same thing on Chrome, it appears Chrome is smart enough to load A.js only once (no load of A.js after jquery that is).
On IE 9 running on Windows 7, occasionally I see that the 2nd dynamic loading of A.js (via < script > tag instead of jquery) fails for some reason. I also see that my default.js will not run correctly (based on user interaction through UX that binds with default.js) if the 2nd loading of A.js fails with bad http status according to network trace.
I would like to debug this myself but it seems pretty hard because the 2nd time loading only fails from time to time. So two basic questions:
1) if the 2nd loading of the same A.js fails, would IE clear the 1st loaded A.js from its cache? I am asking because it seems as if default.js is failing due to missing A.js library.
2) is there any easy way to test this by manually allowing first loaded A.js to go through but the second time fails it at the network request level?
thanks so much