Avoiding .innerHTML slowdowns

You might already have figured out that .innerHTML can be way faster than using the DOM. But did you know that when clearing out existing code the DOM can be faster than .innerHTML? Take a look the article When innerHTML isn’t fast enough to see some impressive benchmarks and a simple solution.

YSlow - Find out why your page is slow

YSlow is a Firefox plug-in which analyzes web pages and tells you why they’re slow based on Yahoo’s rules for high performance web sites. These rules are:

  1. Make Fewer HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires Header
  4. Gzip Components
  5. Put CSS at the Top
  6. Move Scripts to the Bottom
  7. Avoid CSS Expressions
  8. Make JavaScript and CSS External
  9. Reduce DNS Lookups
  10. Minify JavaScript
  11. Avoid Redirects
  12. Remove Duplicate Scripts
  13. Configure ETags

Definitely worth checking out if you need to tweak every ounce of performance you can get on certain pages.