Is there any online tool that we can input the html source of a page and it will minify the code?
I would do that for aspx files that are not a good idea to make the webserver gzip them...
thanks!
Is there any online tool that we can input the html source of a page and it will minify the code?
I would do that for aspx files that are not a good idea to make the webserver gzip them...
thanks!
http://www.digitaloverload.co.uk/jsmin/
and the code for it can be found at http://code.google.com/p/jsmin-php/
perhaps modifying that for html would work? I did spent a short amount of time on google, but nothing showed up for html :/ perhaps you coudld make us all love you and be the first ^_^
CodeProject has a published sample project (http://www.codeproject.com/KB/aspnet/AspNetOptimizer.aspx?fid=1528916&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2794900) to handle some of the following situations...
Don't do this. Or rather, if you insist on it, do it after any more significant site optimizations are complete. Chances are very high that the cost/benefit for this effort is negligible, especially if you were planning to manually use online tools to deal with each page.
Use YSlow or Page Speed to determine what you really need to do to optimize your pages. My guess is that reducing bytes of HTML will not be your site's biggest problem. It's much more likely that compression, cache management, image optimization, etc will make a bigger difference to the performance of your site overall. Those tools will show you what the biggest problems are -- if you've dealt with them all and still find that HTML minification makes a significant difference, go for it.
This worked for me:
http://code.google.com/p/minify/source/browse/trunk/min/lib/Minify/HTML.php
It's not an already available online tool, but being a simple PHP include it's easy enough you can just run it yourself.
I would not save compressed files though, do this dynamically if you really have to, and it's always a better idea to enable Gzip server compression. I don't know how involved that is in IIS/.Net, but in PHP it's as trivial as adding one line to the global include file
Is there any online tool that we can input the html source of a page and it will minify the code?
This seems to be pretty interesting: http://perfectionkills.com/experimenting-with-html-minifier/