Wednesday, March 25, 2009

Minimize HTTP Requests by CSS Sprites


The new launched is facing a loading speed issue. Currently has around 190 HTTP requests on pages, 126 image http requests on homepage, 78 CSS background images.I've done some research on optimization, 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages.

How to improve?

According to first rule of 14 Rules for Faster-Loading Web Sites, Minimize HTTP Requests

How to optimize?

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.
CSS Sprites Generator


Little icons on one image file Examples:




Post a Comment