Greetings I have 10 JS files of 5-10 KB on IIS 10. When entering the site (If the user does not have a cache (That is, CTRL + F5)), the site loads 10-20 seconds each JS file. And the rest of the CSS, IMG (Which 2 mb) for 2 seconds or less.

How do I configure this system so that everything works quickly? Combine JS into one tried. It does not work, the site simply gives hundreds of errors in the console (Google Chrome in F12) and JS files are not loaded.

There are ways to optimize everything?

Here are the screenshots:

enter image description here

Error if you turn JS scripts into one:

enter image description here

  • the site simply gives hundreds of errors in the console - which ones for example? Add a screen where you can see that really small js files load for a long time - Grundy
  • @Grundy I added screenshots. - Jengas
  • The sequence of scripts in the file is important. + Easier to download one file than many, many small ones. It takes more time to the request-response from the server itself than to actually download each of them. - bitrixhater
  • one

1 answer 1

Most likely the problem is that these files use an outdated engine. For example, the browser parses html5 with a new engine, and for compatibility uses an older engine for html4.

As a result, a script that uses an outdated DOM model compiles significantly slower than it could if it had used a newer model.