Sometimes our Angular app seems to load a blank page with console errors implying that the js files have not been loaded in full.
Such errors could be for example: "Uncaught SyntaxError: Unexpected end of input'", or "Uncaught SyntaxError: Invalid or unexpected token" etc.
Looking in Devtools (F12) network tab I can see that the file returns 200 OK but the file seems indeed to be only partially downloaded. If I try to manually download it using a new tab then the file downloads in full.
And again this is not a constant problem and happens from time to time. We noticed that it may be regional as it seems more frequent in some locations more than others. In some regions the vendor.js and main.js take 2 seconds to download each and in the more problematic locations it could take 5-6 seconds each. So one suspicion is that it is some sort of timeout on the loading of scripts.
BTW those scripts are gzipped around 500KB and 700KB in size.
Any idea how to solve this problem? If this is indeed some timeout for loading the script is there a way to increase this timeout?