Forum Moderators: open

Message Too Old, No Replies

reducing your page weight

         

mrMargin

10:24 am on Oct 19, 2004 (gmt 0)

10+ Year Member



Hi guys,

I may have missed a thread thats already been started.

Can anyone suggest a good way of making HTML pages more lean?

reducing the ammount of code, stripping out redundant tags?

cheers

Dave McClure

12:02 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



Hi -
Best way is to get rid of everything except basic mark-up (headers, paragraphs, etc) and put all the style stuff (fonts colours etc) into CSS. This also lets you change the look of the whole site by editing just one file (the stylesheet).

MatthewHSE

12:07 pm on Oct 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a few methods I use:

  • Write clean markup
  • Use CSS for styling and positioning; use CSS instead of JS rollovers, etc.
  • Use the proper tag for the proper job - in other words, write semantic markup
  • Use mod_gzip or similar compression techniques
  • Include as few images as possible (but I never let that get in the way of making the page attractive - if an image is called for, I don't worry about the extra weight)

Things that would reduce page weight more, but that I don't recommend, would include not closing paragraph tags, running the markup together on a single line, or anything else that either will not validate or makes your markup too difficult to read when you need to change the page.

Dave McClure

12:43 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



As an addendum, it's becoming more difficult to keep the HEAD section slim. I sometimes wonder if the benefit of a thorough set of META tags isn't partially offset by the added weight they bring.

MatthewHSE

1:08 pm on Oct 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My meta tags add about 800 bytes per page. I use a SafeSurf rating tag, a general rating tag, turn off the MS Smart Tags and Image Toolbar, add description and keywords, and throw in author and copyright for good measure. Probably those last two aren't necessary; still, I like to have that info in there just in case.

I know what you mean about keeping the <head> clean though. By the time you have meta tags, stylesheets, javascripts, <link> tags, and whatever else, the head can get pretty long. I keep it as lean as possible without sacrificing too much functionality. If my pages do okay at the websiteoptimization.com speed test, I'm satisfied. Normally my stylesheets, javascript and content only take about 15kb, so I don't mind if images come in a little later.

Dave McClure

1:34 pm on Oct 19, 2004 (gmt 0)

10+ Year Member



Matthew - Thanks for the websiteoptimization.com link. I'd not met it before. It's a very useful page!