Author Topic: minifying JavaScript? Any Thoughts?  (Read 555 times)

0 Members and 1 Guest are viewing this topic.

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
minifying JavaScript? Any Thoughts?
« on: June 15, 2014, 08:05:07 AM »
While looking at my Google analytics page I noticed a section on "Site Speed Suggestions" and it says I should minify my javascript files for example it says

Minifying http://www.sunprairieweather.com/ajaxWDwx3.js could save 69.8KiB (53% reduction).

Any thoughts? Just kind of wondering

Thanks Andy

Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: minifying JavaScript? Any Thoughts?
« Reply #1 on: June 15, 2014, 10:52:37 AM »
I routinely minify my bloated 'ajaxWDwx3.js' in order to speed page loads.  One thing to keep in mind though is that you need an uncompressed copy for editing of this particular file since it contains some settings.  The easiest site for me to use is this online javascript compressor.

An alternative scheme would be to save the compressed file as 'ajaxWDwx3-min.js' or some such and reference this as
Code: [Select]
$SITE['ajaxScript']     = 'ajaxWDwx3-min.js'; // for AJAX enabled display in 'Settings-weather.php'.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: minifying JavaScript? Any Thoughts?
« Reply #2 on: June 15, 2014, 11:27:48 AM »
Thanks Ill give it a try

Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

 

anything