htmlcompressor (Java HTML/XML Compressor) is a very small, open source fast and easy to use library that compresses given HTML or XML source by removing extra whitespaces, comments and other unneeded characters without breaking the content structure. As a result pages become smaller in size and load faster.
When compressing the HTML source it will preserve any content within , , and tags by default, but you can optionally turn on or content compression as well using Yahoo YUI Compressor. You can also optionally remove all unnecessary quotes from tag attributes and inter-tag whitespace characters.
When compressing the XML source all whitespace characters outside of the tags as well as any comments get removed. The content inside tags and CDATA blocks remains untouched.
It is also possible to compress selected blocks within JSP or Velocity templates by using corresponding JSP taglibs and Velocity directives.
Detailed instructions on how to install and use the htmlcompressor utility on your Mac are available HERE.
htmlcompressor is a cross-platform utility capable of running on any operating system that comes with Java support (e.g. Mac OS X, Windows, Linux).
What's New in This Release: [ read full changelog ]
· tags with unknown type attribute are getting preserved but not compressed. See Issue #67 for details.
· Space between final tag attribute and a trailing slash is preserved now if attribute value is unquoted (). See Issue #60 for details.