views:

188

answers:

6

I saw this HTML minifier in Ajaxian and it made me wonder if its really a big improvement for webpage to minimize HTML, PHP or CSS files or it doesn't make any big difference? (assuming that they are 100 lines long in average)

+1  A: 

I would doubt that minifying a 100 line HTML or CSS file will make any difference.

I would never minify a PHP file.

Chacha102
A: 

It can make a significant difference when your server is under heavy load. Otherwise, no.

Dolph
+2  A: 

Actually, at 100 lines long about 80% of your total to time to get the file will be network connections -- minifying them will make next to no difference at all. As a general rule you want to reduce the total number of connections you have to make for a given page. Also, when possible, put your JS downloads at the end of the main page because they have to be parsed in order and everything else stops while that happens.

Peter Rowell
+2  A: 

Minimizing is one tool in your toolbox, but to determine if it is appropriate, it is best to profile using a tool like YSlow. Naturally, the top suggestions from such a tool will take priority.

Michael Easter
A: 

A best practice is for large websites to use a CDN (Content Delivery Network) to server JS, CSS, images and perhaps static HTML files. These CDNs charge by bandwidth usage, so you'd want your files to be as small as possible to manage your costs.

jwhat
A: 

Minimizing of PHP file doesn't make much sense. However minimizing of the HTML code that is produced by your PHP script is important.

Zenya