Minified source code is also very useful for HTML code. As an example, successive whitespace characters in HTML are rendered as a single space, so replacing all whitespace sequences with single spaces can considerably reduce the size of a page.
There are a couple of tools available to minify js/CSS code, like Google's Closure-Compiler, Yahoo's YUI Compressor, JSMin, etc. If you are using Maven for your build process, you can use the Maven plugin for YUI Compressor
, as below:
And the plugin repository, is as below:
JQuery-1.7.2.js --> 253 KB
JQuery-1.7.2.min.js --> 95 KB
After the Maven Build, the JQuery-1.7.2.js is minified and the minified js file weighed as noted below:
JQuery-1.7.2-min.js --> 108 KB