Author Topic: Time to forget the GOOGLE recommendations  (Read 2715 times)

0 Members and 1 Guest are viewing this topic.

Offline weatherc

  • Senior Contributor
  • ****
  • Posts: 278
Re: Time to forget the GOOGLE recommendations
« Reply #25 on: May 25, 2017, 02:51:58 PM »
Placing all code into one huge file is IMHO stupid because browser caches JS files and then if you make change in any part of your code you always change this huge file, which must be re-loaded.

Exactly. There are no idea in loading relatively big scripts like say Highcharts or Leaflet on pages where they are not in use either. Some real-world tests showed that combinating to some extent may speed up things tought so I ended up in a middleway here, i have one combinated file with a bunch of small plugins used site-wide and for other/bigger js-scripts (ex. jQuery-plugins not used on every page, Highcharts, Leaflet etc) have i created some combinated files for each script/plugin based on how they are used, for example, i have a leaflet.js and a leaflet-plugins.js. This way is it also possible to control loaded scripts on page-basis.

 

anything