A common question in the minds of webmasters or website administrators, web developers and quality assurance people is that how can we improve the performance of a website? Many factors affect the performance such as server hardware, processing power, data transmission speed and many more. One such factor is the way website has been designed. A properly designed website should produce good results in terms of performance. Following certain basic things that I have observed, the performance of the website can be drastically improved without much compromising with the functionality. Let me tell you those things one by one.
- Use optimized images: The images used in websites should be as small in size as possible. Less bytes mean less loading times. Depending upon the type of colors the image contains, proper image formats should be used. e.g. if the image contains solid colors or less detailed contents .png or .gif formats must be considered. For images with real world or nature images, jpg file format should be chosen for optimal performance.
- Use css sprites and less number of javascripts and css files: The number of http requests that is made from client to server is directly propotional to the number of files that are requested. Thus more images mean more http requests. This causes more bandwidth usage and increases load on the server. CSS sprites are special images created by merging all the images together into one image. The background-image and background-position property of css styles can be used to properly position the images on webpage. There are many websites that offer you to merge the images automatically and generate CSS for those files. Similarly instead of having too many javascripts and css files, try to merge them all in single files so as to reduce the overall http requests.
- Precompile if possible : Although not possible with every web technology, technologies like ASP.NET offer flexibility to precompile the website code into dlls. This reduces the load on the server to compile the website. Although the server compiles these files once, this can give a bit of delay when first request is made for the website. Precompilation will help to reduce that delay.
- Use caching: The client side caching is a way to cache the images and data on the client side browser or computer. Using caching helps improve the performance by reducing the overall load on the server. This is because the resources that do not change frequently are cached and are not requested by the client again and again.
No comments:
Post a Comment