How to Enhance Website Speed

April 25, 2010 – 10:36 pm

Website Speed is one of the most critical diagnostics for measuring the website performance. A slow website, with a large response time is more of a turn-off in terms of user experience than a badly designed fast responding website.

We all have been developing websites, but how many times have we truly optimized it for speed? Presented below, are some simple, yet useful techniques for improving the website’s performance by improving its speed.

1.Database indexing: Faster database querying

All the avid, as well as, the not-so-avid readers know the importance of the Index Page in a book. The index of a book serves as a page, which tells you where to look for particular information inside the book. Just similarly, the index created on a database table tells the query engine exactly where to look for a particular record in the database.

The general rule of thumb for database indexes is: items that are contained in your WHERE clause are ideal to be indexed.

  • Create ONE index for the multiple fields.
  • Include fields in the ORDER BY clause as indexes as well. By adding indexes for your ORDER BY clauses it will prevent MySQL from having to re-sort your data each time before it is returned to you.

However, there are down falls to having too many indexes. The more indexes you have, the longer each insert statement you perform will take because MySQL needs to update the indexes to include the new data.

2.Use Cache: A repository of web pages

It is the technique in which the HTTP request fetches its response from a repository of previous responses, rather than going to the server for fetching information. The thing to be kept in mind here is:

Let the response come from the cache if the information has not changed on the server, or has not become stale, however, go to the server in case the information has changed since the last fetch.

We normally use ‘Expires’ or ‘Cache control’ headers for implementing caching.

  • Expires is used for static content like images which, usually do not change regularly, and even for letting the cache know when should it refresh itself in case of dynamically (but regularly changing content).

Syntax: Expires: Fri, 30 Oct 1998 14:19:41 GMT

  • Cache-Control are a special class of HTTP headers, which are more flexible and more powerful than the Expires header.

Syntax: Cache-Control: max-age=3600, must-revalidate

Visit the blog again for more information on how to enhance your website speed. To be continued…

Post a Comment

*Please fill correct value in the text box given below.