views:

55

answers:

3

Hello, i need to compress or optimize the html page to give better perfomance,, so please tell me what tool will be best for it,,,

A: 

use this tool: http://www.textfixer.com/html/compress-html-compression.php

Read more: How to Compress HTML Code for a Webpage | eHow.com http://www.ehow.com/how_2317410_compress-html-code-webpage.html#ixzz0tXRT0bkk

dejavu
A: 

You can try something like this: http://www.alentum.com/ahc/

alexanderb
Mind that the program will erase `"` around attribute values, which might cause the HTML to be invalid.
Erik Töyrä
+5  A: 

The best performance boost would be to compress the content you're sending to the client at runtime. It will give you a far better performance boost over removing line breaks etc. using various programs.

Apache module mod_deflate

Apache has a module called mod_deflate which handles compression of files at runtime. All modern web browsers (that I know of) will support this type of compression. Quoted from the mod_deflate manual:

The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

Assuming you're using Apache, locate the .htaccess file in the directory and paste the following lines of code:

# START gzip compression
<ifmodule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END gzip compression

If the mod_deflate module is installed (which it should be) this will compress files such as TXT, HTML, CSS and JavaScript in the same directory at runtime. If you only want HTML to be compressed, delete all but text/html.

For a real in-depth overview and guide on how to setup mod_deflate, see Compressing Web Content with mod_gzip and mod_deflate.

References

Erik Töyrä
+1 equally, IIS can compress both static and dynamic content. I imagine most of web servers can also.
CJM