I have some abstract question. Lets say I have a website which uses 1000+ JS script files. (Not at once, but in the overall 1000+ JS scripts are needed if user goes through all existing flows).
I know that using RequireJS I could dynamically load whichever scripts I need, and that saves me a long time loading them all at once. But!
In order for RequireJS to load the JS files, they need to be downloaded by the client. So what happens is that the first time I open the web page, I download more than 1000 JS script files, which takes long time too!
I was wondering if there's any way for dynamic loading to also dynamic download them from remote. I know that for this to work best, there must be some clever mechanism that will finish download them before something tries to use them, otherwise it'll slowdown things.
Anyway, I hope you understand my question, I want to avoid downloading 1000+ files on the first time I open the page. I'd like them to be downloaded on demand.
I can't make combine them to a single file like many web sites do.
Thanks for your help and discussion :)