The Microsoft Ajax Minifier is a small tool to remove unnecessary content from your js or css file. It can bring down the size of js file by 60%. You can download the Ajax Minifier from here.
After installing the tool, you will get a command prompt
and let’s say I have a js file with name “Validations.js” Let’s try minifying the file using this tool
A point to note here is:
Original Size: 7710 bytes; reduced size: 4918 bytes (36.2% minification)
Gzip of output approximately 1586 bytes (67.8% compression)
Currently the Ajax Minifier ships with two modes of
With normal mode, it removes extra whitespace, all comments etc. When you use Hyper crunching mode it takes some more additional steps that includes shorting the name of local variables etc.
In order to use hyper crunching mode you need to add –hc switch in the command line. For instance:
ajaxmin validations.js –hc –o validations.min.js
So go ahead and try it out. Another great thing is that Ajax Minifier can be integrated with Visual Studio as well, which I will cover in the next post.