Summary

In order to fully optimize your HTML, you've got to do more than remove whitespace. Transform your code by tuning your tables or replacing them with positioned divs . Optimize your forms and use JavaScript to save clicks and HTTP requests , and replace complex DHTML and Java menus with standards-based cascading select menus . Most importantly, auto-abbreviate your URLs with mod_rewrite and use content encoding to compress your content for maximum speed. Here's a summary of what you learned in this chapter:

  • Table tips:

    • Use row groups to segment tables for style, accessibility, and printing.

    • Use colgroups and col to style entire columns .

    • Consolidate attributes ( tr versus many td s, and so on).

    • Enable incremental rendering with sized col elements.

    • Use the fixed table-layout algorithm where possible (NS7+, IE5+).

    • Simplify, unwind, and layer your tables for maximum speed. Provide useful content in the first table.

    • Use the table trick to raise relevance.

    • Use CSS to style cell backgrounds (version 4+ browsers).

  • Forms:

    • Use JavaScript to save clicks and HTTP trips.

    • Gracefully degrade with CGI scripts for non-JavaScript browsers.

    • Use GET where possible.

    • Shunt form defaults into CGI scripts.

    • Substitute optgroup select menus for DHTML hierarchical menus.

  • Use trailing slashes on directories.

  • Abbreviate your URLs.

  • Use compression where possible.

Recommended Reading

Here are some good sources for more information on optimizing HTML:

  • http://www. webreference .com/authoring/languages/html/optimize/ "Extreme HTML Optimization," by Andrew King.

  • http://www.gzip.org/ The gzip compression format.

  • http://www.w3.org/TR/html401/ "The HTML 4.01 Specification" (see also the Performance, Implementation, and Design Notes).

  • http://www.webreference.com/internet/software/servers/http/compression/ "HTTP Compression Speeds Up the Web," by Peter Cranstone.

  • http://www.schroepl.net/projekte/mod_gzip/ Michael Schroepl's excellent mod_gzip site.

  • http://www.glostart.com/webtrimmer/fluff.html A discussion of waste data in HTML documents, by Cub Lea and Stephen Winter.

 



Speed Up Your Site[c] Web Site Optimization
Speed Up Your Site[c] Web Site Optimization
ISBN: 596515081
EAN: N/A
Year: 2005
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net