Posts Tagged ‘web’

Website performance

Thursday, April 24th, 2008

These are some quick apache tips to improve the performance of your web site:

  1. compress your html/css/js content by making these changes to your httpd.conf
    SetOutputFilter DEFLATE
    AddOutputFilterByType DEFLATE text/html text/css application/x-javascript

    To see it working, install livehttpheaders addon in firefox, open Tools->Live HTTP headers, and fetch http://www.technologydb.com/. In case some headers are missing, clear your firefox cache. Here are the screenshots:

    firefox header gzip html

    firefox header gzip css

  2. cache images, css and js
    ExpiresByType text/css “access plus 240 hours”
    ExpiresByType image/jpeg “access plus 24 hours”
    ExpiresByType image/jpg “access plus 24 hours”
    ExpiresByType image/gif “access plus 24 hours”
    ExpiresByType application/x-javascript “access plus 24 hours”

    This will avoid browser making an http call to server for these content types.

  3. Avoid using too many domain names. Each domain require a DNS lookup which is expensive.
  4. Keep limited number of css and javascripts files. Browsers generally limit parallel number of fetches.

For a full list of advanced tips on website performance you can view this excellent page maintained by Yahoo Exceptional Performance (http://developer.yahoo.com/performance/)