How to minify your JavaScript files and why you shouldn’t wait

It is common in fast responsive web apps to minify JavaScript files to reduce file size and increase app performance.

What is it?
Minification means to remove all unnecessary characters (e.g. comments, spacing, line breaks, shortening names, etc.) from a JavaScript file so that the resulting file behaves the same but is much more compact.

Why should you minify your JavaScript files?
Here are some benefits:
– Faster load speed
– Small files and cache size
– Less demand on your web server
– Uses less bandwidth especially on mobile devices

How to minify your JavaScript files with two popular tools:
YUI Compressor
Closure Compiler

How to de-minify your JavaScript files:
To make things easier to debug/visualize minified JavaScript files, you can de-minify JavaScript files in IE by launching IE Developer Toolbar | Debugger | Turn pretty print on. For keyboard people, use F12 | Ctrl+3 | Ctrl+Shift+P.

Phong Hoang
Development Manager
ImageSource, Inc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s