Post news Report RSS More SPEED!

Using Minify to speed up the sites Javascript and CSS.

Posted by on

We are now using Minify to combine, compress and cache our use of Javascript and CSS on the site. Regular visitors most likely won't notice a difference, because if you are using a good browser all of the current Javascript and CSS files should be cached anyhow. For those visiting with an empty cache, the site should be much faster to load. This is due to:

  • Less HTTP requests (multiple JS files combined into 1)
  • GZipped / minified download (so smaller download size)
  • Javascript's loading last once most of the page has rendered
  • Setting proper expire headers

This all happens automatically and on the fly. I tried loading Javascript in a "non-blocking" manner, as explained by the Yahoo experts but found keeping the order of code processing difficult. This meant Javascript would throw errors if the function it depended on was not yet available. I could have overcome this by creating a "ready" function, but this would mean quite a few code updates and given that future browsers plan on loading javascript in parallel, the benefit would be short lived.

Post comment Comments
feillyne Staff
feillyne - - 5,816 comments

So using multiple JS files slows down the performance? Good to know. :-)

Reply Good karma+1 vote
INtense! Author
INtense! - - 4,099 comments

Well more files means more HTTP request / response. This means more packets plus and your browser only loads two urls in parallel - so merging these files will provide a slight improvement.

Keep in mind though that most modern browsers cache really really well so the difference probably wont be noticable... this is mainly for new visitors to the site, we want it to load fast the first time.

Reply Good karma+3 votes
Dremth
Dremth - - 1,400 comments

I have noticed a slight speed increase. Essentially a fast site has been made even faster. However, for some reason, the search bar at the top is sometimes misaligned.

Reply Good karma Bad karma+3 votes
KindredPhantom
KindredPhantom - - 290 comments

Drugz are bad m'kay.

Reply Good karma Bad karma+1 vote
jjawinte
jjawinte - - 5,067 comments

Well done INtense! Any increase % is a good one.

Reply Good karma Bad karma+2 votes
diesal_11
diesal_11 - - 88 comments

Does this affect images at all?

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: