Export to GitHub

htmlcompressor - issue #86

How to use the htmlcompressor?


Posted on Jul 3, 2013 by Swift Cat

Hello,

I downloaded the file "htmlcompressor-1.5.3.jar" but I do not know how to compress HTML. Can someone post a step by step? I am using Windows 7

Thanks!

Comment #1

Posted on Jul 25, 2013 by Grumpy Camel

If you are using maven, look at this plugin...otherwise,

https://github.com/TUNYK/htmlcompressor-maven-plugin

com.tunyk.mvn.plugins.htmlcompressor htmlcompressor-maven-plugin 1.3

If you are using ant, look at yui-compressor-ant-task.

yui-compressor-ant-task

I worked on yui-compressor-ant-task to bring htmlcompressor support to it. You can do it separately but it is slow without using this task. In addition to html compression it will give you css/javascript compression as well. If using maven, there is a separate plugin for css/javascript and with maven both are rather fast.

Both of the above will get compression completed even against jsp/jsf fragments prior to build. I believe it was stated on this site not to do such a thing but it does partually work and works well. While doing so at build won't get full compression potential, it goes a long way to make things such as googles page speed see this as properly compressed. I use JSF and was unable to get it working through code. So I simply went with the build process solution and have been satisfied with it.

Status: New

Labels:
Type-Defect Priority-Medium