javascriptminifyyui-compressormicrosoft-ajax-minifier

Reliable and convenient JavaScript minifier


I occasionally write JavaScript code. I am interested in minifying it for better performance, but I don't plan to spend to much time on that, especially in testing the minified result.

I found this online service: http://www.lotterypost.com/js-compress.aspx

So a couple questions:


Solution

  • That link you post happens to be the one that I use too.

    Use the MS AJAX Minifer. It's way better than the yui one. besides:

    http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx:

    The Microsoft Ajax team (I work on this team) has been using this tool internally for a number of years. For example, we use the Microsoft Ajax Minifier to minify the Microsoft Ajax Library before publishing it.

    Well if you don't trust me, run your source code (if you don't have an actual source code to test, just grab the source at http://code.jquery.com/jquery-1.6.2.js) through both and see which is more "minified".

    ==

    Google has the Google Closure Compiler but it analyzes your code and removes unreferenced code (to furthur reduce the size of the resultant file). However usually this is not what you want because even though the functions/variables are not referenced within that file, it may be referenced from your other js files that make up your site)