Posts Tagged ‘javascript’

Causes and Solutions for Slow Websites

Thursday, August 26th, 2010

Does it take forever to load pages on your site?  Does it feel so much like you’re on dial-up that you can almost hear the modem noise?  In case you forgot (or you’re too young to remember), here it is:

There are a number of reasons your website could be running slow, even if you’re on a high-speed internet connection.

Slow Server

This is something you’ll have to discuss with your hosting company.  There are a lot of different reasons that a server can be slow, but there’s not much you can do about it if you’re not a server admin.  In the interest of brevity, I’ll just say that if the server is the issue and your hosting company can’t do anything about it, it might be time to search for a new website hosting company.

Large Files

In particular, I’m talking about images.  I’ve probably seen hundreds of websites where someone uploads a full-size digital image and then uses the image properties to shrink it down.  Sure, the image only takes up 300 x 200 pixels on the screen, but it’s actually a 3000 x 2000 pixel image scrunched down to that size.  Unless you change the size of the before you upload it, it’s still, in reality, a really big picture, and a big, full-quality picture is always going to take a lot longer to load than one that has been optimized for the web.  And when you try to create your own photo gallery of images that haven’t been optimized for the web, you’ll definitely feel like you’re back in the dial-up age.  Besides, a scrunched-up image looks terrible compared to one that has been properly optimized.

There are a few of options you can use for resizing a picture prior to uploading it.  There are lots of programs out there, such as Photoshop, GIMP and even MS Paint that easily take care of resizing picture.  There are lots of websites out there too.  Just do a search for image resizing and you’ll find plenty of them.

Another option is to see if your web designer can install a program that will resize the images for you automatically when you upload them.  For example, if you use our ecommerce solutions and upload a category or product image, we can set the parameters of the uploader to set the image to a specified height and/or width.

While I’ve mainly focused on images here, you could have the same issue with any sort of media such as Flash, music or videos.  Remember that the web, as nice as some things look on it, is geared (at least for now) towards low resolution.  For example, a client of ours recently sent me an audio file of a radio commercial she wanted to play on her homepage.  I noticed the large file size, re-sampled it to a lower quality and cut down the file size by about 75%.  And you know what?  It still sounded fine on her website.

Just remember that in order for your page to load fast, you’re going to want to make all your files as small as possible while still maintaining an acceptable quality.

Coding

This ties into my last point, to a degree:  The smaller the size of the files on your page, the faster it will load.  By that same token, the smaller your page’s file size, the faster it will load.  You’ll most likely have to talk to your web designer about this, but optimizing your code includes such things as converting the site to CSS, linking to external files (such as one consolidated CSS file and one consolidated javascript file) instead of coding them directly in the page and reducing unnecessary white space in your code.

Of the three suggestions I gave, the one that will usually make the biggest difference is converting a site to CSS.  Now, I don’t want to get into a CSS vs. tables debate, but the fact of the matter is that a site using pure CSS is going to have a lot less code than a site using tables, so it’s going to be faster.

The problem that a webmaster will sometimes run into in telling a client that they need to optimize their code is that a client won’t see a difference in the site, so some website owners are hesitant to shell out the dough necessary for a website coder to spend hours on updating their site’s guts.  Cleaning code isn’t sexy, but it can be extremely effective in speeding up a website.

Making sure your site loads quickly will not only make your website visitors happy, but it will make Google happy as well.  Search engines put a premium on sites that are quick to load, so it can also push your website up in search engine rankings.

If you have any questions about how to go about doing some of the things I mentioned above, feel free to leave a comment below, contact us or send us a Tweet.