As a web developer and designer, many times I face situations where web pages take more time to load, which is very undesirable not only to client but also to end-user. So, many times to make clients and end users happy I tried to do research on how to improve performance of my web page. I found YAHOO's Best Practices for speeding up your Web Site is a very nice place to where one can find best solutions to improve performance and speed up your Web site. Besides content of above article I found many more interesting and practical ways to speed up Web page, which I listed below for benefit of other developers.


1) Save Images in right format to reduce their file size.

JPEG vs GIF screenshot.

If you have a lot of images, it’s essential to learn about the optimal format for each image. There are three common web image file formats: JPEG, GIF, and PNG. In general, you should use JPEG for realistic photos with smooth gradients and color tones. You should use GIF or PNG for images that have solid colors (such as charts and logos).

GIF and PNG are similar, but PNG typically produces a lower file size. Read Coding Horror’s weigh-in on using PNG’s over GIF’s.

  • 1)If you have to place a background image, some large image or a screenshot then the suggested format is JPG/JPEG.
  • 2)If you have to use small graphics like button images, header images, footer images, navigation bar images or clip arts, then the suggested format is PNG.
  • 3)If an image is not required to be in high or true colors and 256 colors are enough, then GIF is preferred.

2) Use Css Sprites to reduce HTTP

CSS Sprites on Digg.

A CSS Sprite is a combination of smaller images into one big image. To display the correct image, you adjust the background-position CSS attribute. Combining multiple images in this way reduces HTTP requests.

For example, on Digg (shown above), you can see individual icons for user interaction. To reduce server requests, Digg combined several icons in one big image and then used CSS to position them appropriately.

You can do this manually, but there’s a web-based tool called CSS Sprite Generator that gives you the option of uploading images to be combined into one CSS sprite, and then outputs the CSS code (the background-position attributes) to render the images.


3) Off-load site assets and features.

Amazon S3Fox for Six Revisions.

Unloading some of your site assets and features to third-party web services greatly reduces the work of your web server. The principle of offloading site assets and features is that you share the burden of serving page components with another server.

You can use Feedburner to handle your RSS feeds, Flickr to serve your images (be aware of the implications of offloading your images though), and the Google AJAX Libraries API to serve popular JavaScript frameworks/libraries like MooTools, jQuery, and Dojo. This allows our server to handle just the serving of HTML, CSS, and CSS image backgrounds. Not only are these solutions cost-effective, but they drastically reduce the response times of web pages.


4) Use Cuzillion to plan out an optimal web page

Cuzzillion screen shot.

Cuzillion is a web-based application created by Steve Souders (front-end engineer for Google after leaving Yahoo! as Chief of Performance) that helps you experiment with different configurations of a web page’s structure in order to see what the optimal structure is. If you already have a web page design, you can use Cuzillion to simulate your web page’s structure and then tweak it to see if you can improve performance by moving things around.

View InsideRIA’s video interview of Steve Sounders discussing how Cuzillion works and the Help guide to get you started quickly.

5) Using Get method for AJAX based requests

use the GET method for Ajax based Requests, because if you use POST method then the request header would be sent first, followed by the data, which basically splits the request in two steps. A single-step request can be achieved with GET if a cookie is not too long and the URL is not larger than 2k.

  • When using ASP.NET AJAX and the UpdatePanel control for partial page rendering, use the maximum number of update panels to update small chunks of page, but use them wisely. Don’t set the Update property to Always unless needed. Instead, set the update mode to Conditional, otherwise all the partial chunks would be sent together after each asynchronous postback.
  • Ajax based requests can also be cached when using the GET method. If the URL is the same, then cached data can be used from the client, and a round trip to the server can be avoided.

6) Using Call backs instead of AJAX in some situations.

Ajax is a great solution for asynchronous communication between client (web browser) and HTTP servers, but one solution can't be applied to every problem. This means that Ajax is great mechanism for sending requests to the server without making a full page postback, but what if you need to send a request to the server and don’t even need partial rendering?best solution is Callback.

For example, if you need to check whether a user exists or not, or if a user has forgotten his/her password and you just need to send a request to the server to check if user name exist, there is no need for client-side render - just a server side operation.

Following is great links which explain callbacks: Please click Here.

And many more to come....

Comments (0)