Saturday, November 15, 2008

Improve Your Web Site's Response Time

  • Use Combined files
Combined files reduce the number of HTTP requests by combining all scripts into a single script, and all CSS into a single stylesheet which improves response times because .css files are normally cached by browsers.
  • Use CSS Sprites
CSS Sprites are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS background-image and background-position properties to display the desired image segment.
  • Use Image Maps
Image maps are used for combining multiple images into a single image so that it reduces the number of HTTP requests.

  • Use HTTP Compression
HTTP Compression can result in great performance gains. Gzip and deflate compression mechanisms can reduce the size of the payload by about 50%.
  • Minify CSS and JavaScript
CSS files (.css) and JavaScript files  (.js) can be minified, as normally .css and .js files contain unnecessary spaces, comments, unnecessary code and such other things. You can use some utilities to minify your files.

You can use JSMin to minify .js files and use YUI Compressor to minify both .js and .css files
  • Put StyleSheets into the Header
When putting the StyleSheets between the HEAD tags of a web page, the browsers loads the web page progressively.
  • Put Scripts at the end of the Page
Scripts block parallel downloads. While a script is downloading, however, the browser won't start any other downloads, even on different hostnames. So putting scripts to the end of the document reduces pages response time in total.

No comments:

Related Articles