Five Reasons Why Your Web Page May Be Slow

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

When you find that your website is slow, there can be many possible reasons.

To check on the performance issues, you can see the page load  time and its various components by using FireBug’s net tab.  Slow performance can be due to large image sizes, blocking scripts, content management systems, slow database, and slow web host.

1. Large image sizes can cause pages to be slow.

Before putting any images on the webpage, you need to optimize the size and quality of the image for the web.   What you want is to make the image have the smallest filesize as possible — less than 50KB is ideal.

This means using Photoshop or Firework to size the image down to the size that it is actually needed.   If you only need a 200 pixel wide image on your page, do not use an 2000 wide image (which is often the size that comes out of your camera) and just let the image tag width attribute resize the image.

Second, you want to decrease the quality slightly to reduce filesize.  It is often a trade-off between quality and filesize.  Image for the web does not need to be as high quality as images for print.  Again do this in Photoshop and Firework, and they will often indicate the estimated filesize per quality adjustment.

However, if your page has a lot of images, then even well optimized images can add up.  In that case, you can use advance techniques such as image sprites.  This technique lumps many images into one image in order to decrease number of server requests for images.

Although Flash content are not really images, you also want to check the filesize of your Flash swf files if you have any.   Sometimes Flash filesizes can be reduced by reducing the image sizes that the Flash is using.

2.  Blocking Scripts

When your site has a lot of scripts needed to do a lot of fancy things, it can add to the page load time.

Take a look at the types of scripts that are being loaded by each page.  Scripts can be calls to JQuery, Javascripts, YUI, mootools, etc.

Try putting the scripts at the bottom of the page instead of in the head if possible.  That way the page loads before loading the scripts.

If you are using JQuery script library, experiment with calling the JQuery library that is directly on Google’s free CDN (content developer network) instead of hosting the JQuery library on your own shared webhost server.    Sometimes Google’s CDN may be faster than your own webhost server, sometimes not.   It depends; so you have to experiment.

3.  Content Management Systems

If you are running a content management system such as WordPress, Joomla, Drupal, ExpressionEngine, and the like, they run an interpreted language called PHP.  The server has to parse and run PHP code.  This put additional overhead in page load times.

4. Slow Databases

Further, content management systems will be using a database on your server.  In fact, nearly each page load will be making one (and on occasions multiple) queries of the database.

If your database is on a shared web host where it services hundreds of websites, then the database can be overloaded.

5.  Slow Web Hosts

Shared web hosts are the least expensive category of webhost and they are entry-level web hosts.  They are the most common and most popular.   However there are some disadvantages of shared web hosts.  It is due to the fact that one server supports multiple websites — sometimes hundreds of sites. If the hosting company puts too many websites on one server, the performance of that server can degrade, causing your websites to load slowly.  If any website on that server experiences a huge traffic spike, it will affect performance for all the websites on that server, including yours.

Possible Remedies

If your own site is the one experiencing large traffic increases causing performance problems, it may be outgrowing the shared web host.  In that case, it may be time to upgrade to an higher category webhost.  The next step up is VPS, virtual private servers.   And the next step higher is dedicated servers.  However, there are advantages and disadvantages of upgrading to VPS as mentioned here.

It is an important decision and there is work involved in upgrading.  Before upgraded from a shared web host, you might want to try using caching technology if you are running a content management system.

Server-side caching helps eliminate the overhead of running PHP and querying the database and slow web hosts.   Instead of interpreting PHP and querying the database on every page load, it will generate static saved snapshots of those pages.   This will work great if your site does not have a lot of dynamic content.

In Joomla, make sure you turn on caching.  In WordPress, try installing WordPress SuperCache plugin.


Related Posts

Share This