Your site is becoming slow, slower, and slooooowwwwer

Developing websites today requires interaction with users and 'something' to keep users coming back. Creating a website is no longer simply throwing up images, copy, and hope your site achieves everything you desire.

Adobe Flash used to be widely used to achieve a rich user experience with websites, but JavaScript has made a reappearance and taken charge of creating the desired user experiences. Once a website has been launched, you simply can't help it but enhance it - and don't be shamed, it's worth it. But often we add too much way too quickly and everyone may not have a super fast Internet connection like you do.

Whilst writing JavaScript or CSS, it's good practice to keep your files separate, but when a user downloads all your files, it's all the initial server requests for each file that are slowing down the page the most. You could develop all your JavaScript and CSS in two files, but you can easily go over 5000 lines before you know it - which makes it extremely difficult to develop more, test and debug.

Unfortunately, the more you add to a website the slower it becomes to download and view. Fortunately, there are a million methods or probably just 20 (I haven't counted) to enhance the speed of your website.

Firstly, install YSlow from Yahoo, it also requires Firebug. YSlow offers suggestions for improving the page's performance, summarises the page's components, displays statistics about the page, and provides tools for performance analysis, including Smush.itâ„¢ and JSLint.

Read through each suggestion YSlow supplies and you will find your site's download and viewing speeds increase with every change. As to speeding up the JavaScript and CSS files, I recommend Minify to combine the multiple CSS or Javascript files, remove unnecessary whitespace and comments, and serve them with gzip encoding and optimal client-side cache headers.

By using Minify, you can reduce the time taken to download your site by over 300% simply reducing the number of files to download.

This entry was posted on Sunday, November 15th, 2009 at 5:06 pm and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Your site is becoming slow, slower, and slooooowwwwer”

Hey, I found this blog post while searching for help with JavaScript. I have recently switched browsers from Google Chrome to Microsoft Internet Explorer 8. After the change I seem to have a issue with loading JavaScript. Everytime I go on a site that needs Javascript, my browser freezes and I get a "runtime error javascript.JSException: Unknown name". I can't seem to find out how to fix the problem. Any help is greatly appreciated! Thanks
Thanks for the tip Dallas, I've gone through my code and applied all the YSlow tricks. It's made my site go from 38 seconds down to 7.

Thanks a lot !

Leave a Reply