Search code examples
phphtmlcssminimize

Is it really a big improvement for a webpage to minimize HTML, PHP or CSS files or it doesn't make any big difference?


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)


Solution

  • 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.