HTML minification

Discussion about HTML and XHTML related issues.

HTML minification

Postby BlackWhiteRed » Fri Jan 21, 2011 7:23 am

Ive been looking into my making my website faster and was wondering if I should minify my html. Is this worth it? I guess what I really need to ask is how much speed improvement I can expect to gain from it. Some of my pages are pretty long with text and illustrations, but all in all pretty normal. What do I need to pay attention to in order not to mess things up? Thanks.
BlackWhiteRed
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 1
Joined: Fri Jan 21, 2011 7:11 am
Location: Arizona

Re: HTML minification

Postby MikeGale » Fri Jan 21, 2011 3:14 pm

I don't think I've ever gone the minify route with X/HTML.

It's ugly, harder to maintain and of limited benefit.

I don't know any details of your web site. I find a good fast server, compiling the programmed bits and good attention to code design can give lightning speed.

If it's just markup a good fast server still applies. (I've had ISP's move web sites to alternate shared machines to achieve this.)

Working on images is always a good idea and can make a difference. (Note: it's not always the same format that gives you best results, gif, png and jpeg all have their place in the sun.) I'd put that ahead of minification.

I know that some smart people set things up to compress the payload from the server. (gzip) There used to be some problems doing that but I believe it's now much better. I imagine that will also outperform minification.

For a discussion of this issue I found http://stackoverflow.com/questions/728260/html-minification which gives additional hints, including tools that advise you on what to do.

Another thought. If your site has a lot of JavaScript writing it, be very careful. I've recently seen several high profile sites that do this and simply get it wrong. Their code takes so long to run that you just leave the site before it's done.
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
 
Posts: 637
Joined: Mon Dec 13, 2004 2:50 pm
Location: Tannhauser Gate

Re: HTML minification

Postby Albert Wiersch » Fri Jan 21, 2011 3:28 pm

It's hard to help without a link to the site.

Just "compressing" the HTML to remove unnecessary space characters is probably a bad idea and won't help much... but there could other issues that could make a big difference, like large resolutions images that are 500K or larger that are set to display at 200x300 pixels or similar small size. They could easily be downsized and made much smaller in file-size. I've definitely seen that before.

Excessively long pages could also be divided into multiple pages.

Making sure there are no big structural issues in the HTML could also help increase rendering speed (check with a validator like CSE HTML Validator).

And of course what Mike said, a fast server is always good.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2653
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX


Return to HTML and XHTML

Who is online

Users browsing this forum: No registered users and 4 guests