-2

I built a website which use a lot of different scripts and files, for plugins etc.

I am thinking of how I can make the loading process of these scripts.

I want to load all files and script after a login page, at first with a kind of status-bar ("files are loading....x %").

The idea is to load all files and make the page faster, because the files comes from the cache.

What's your opinion and which is the best way to do it?

Until now, I have include all files with the classical way (link, script, img etc)

4usolutions
  • 269
  • 1
  • 4
  • 12

1 Answers1

0

I do not think its convenient to do this that you are saying... to load all files after login instance, except that all those files are going to always be used on all web site pages.-

I think a most convenient strategy would be a load on demand strategy ....

An example of load on demand would be to test at runtime whether or not certain browser capabilities and if not then bring them by loading on execution time a specific .js (polyfills).

If the browser has this capability then don't load the .js.-

See Modernizr.js a Paul Irish js library to test browser capabilities at execution time.-

Here another reference explainning how to conditionally load a pollyfills.-

Community
  • 1
  • 1