2 June 2011

How to Improve Your Websites Speed

"Why is my website slow?" is a popular question. And it is a vital problem for a website. Faster the website, happier & more the visitors. That's a well-known fact.

There are several factors that may slow a website. In general, all of them can be solved. This just depends on how much effort you can spend on it.

1. Get A Fast & Less-Loaded Web Server

This is a must. Whatever you do to make your website faster, if it is served slow, there's nothing to do.  Make sure that the server your website is hosted has low ping values & it is not over-loaded. Specially if you've a database and/or using dynamic files (like asp, asp.net, php, ruby..) server over-load can kill the performance.  If you've a simple website with few visitors then shared hosting is ok. For a website getting popular, think of a VPS with guaranteed RAM & CPU usage. If the website is already popular, a dedicated server will be the best performing one.

2. Know When To Use GIF, JPG & PNG Files.

Playing with the quality of images will dramatically lower the sizes of them while they will still be looking good.

GIF is suitable for images with few colors like logos, text & line art. When saving a GIF file, make sure you use a small color pallette.

JPG is good for images with lots of colors & details like photographs. Decrease the quality of a JPG image before saving. It will still look good for a web image.

PNG, a format specially for websites, has great quality – both transparent & non-transparent – is specially functional when you're in need of quality transparent images. Don't forget that IE6 has problems in displaying them.

3. Use XHTML – No Tables

This is easy to tell but may be harder to implement for anyone that has few experience with XHTML.  The thing is, tables are rendered slower than DIVs by browsers. You can do more with less code & no need to say it is much better to be compatible with any browser (including mobile browsers), in means of SEO, etc..

Update: There may be cases when using tables are much more logical like "tabular data". You may have to code a lot for creating the look of a simple 5 columned table. Don't do that & use tables when needed.

What is tried to be mentioned here is, use XHTML rather than tables in general. But don't try to draw images with XHTML.

4. Use CSS Smartly & Compressed

  • Mention every style in CSS files.
  • Find the common properties in objects, define them once & try not to repeat them.
  • If using a significant amount of totally different properties for a specific page, define them in another CSS file & only include on that page. So users viewing other pages won't need to download those properties.
  • Compress your CSS file.

5. Cache Webpages

Caching is a superb way of decreasing the stress on the server by running more static files & less queries. It simply saves a static, HTML version of the page to be displayed & displays that file rather than the dynamic one.

For CMS applications like WordPress, there are already ready-to-use caching plugins (like WP-Cache).  A small note, caching can also be done at the web server level. But if you're on a shared hosting account, you better be lucky to have it on.

For all your computer support requirements, feel free to contact Farend, for no obligation quotation.

The above article was originally published at: http://www.webresourcesdepot.com/tips-to-improve-website-speed/