Speed Up your Website, Quick!

Have you ever gone to a website that just loads pretty slow, or the content loads fine but the images take foreverrrrr. This is always something that is frowned upon from web master and even basic readers. Maybe you just started your blog or website and haven’t really thought about how fast your website is. Just because you pay upwards of $100 bucks a month for a T3 connection, that still leave out all of the people that steal internet from their neighbors(Wi-Fi)!

This guest article was written by Hayes Potter, the 13 year old web developer and designer.

First thing you need to do is to find out how to access your “.htaccess” file in your server. Please note the following tricks are only for Apache Servers.It is usually either in the home directory or some file management systems put it in a higher directory not accessible through your domain name. If you use cPanel the “.htaccess” file is hidden so you need to view the hidden files in your directory. Once you find your “.htaccess” file you need to open it up for editing, now lets start with Gzipping some components. Doing this makes some things have a smaller file size, its like compressing a file but with Gzip it’s still accessible. Put the following in the top of your “.htaccess” file:
Please note that if you use pretty permalinks in wordpress there will already be some code at the top of your “.htaccess” file you MUST put all of your new code under it.

<IfModule mod_deflate.c>
<FilesMatch ".(js|css)$">
SetOutputFilter DEFLATE

This deflates all of the .js and .css files in your server, you can add “.jpg|.gif|.png|.tiff|.ico” or whatever you want to compress other file types, too.

For our next trick I’ll show you how to add expires headers to your files, this will load the file types you specify only once, from then on they are already loading in the cache so it makes your site run faster. Although you should only add expires headers to file types that do not change a lot, like css files and javascript. If you already have a bunch of images on your site then add some it does not matter it will automatically add the expires header to it. If you do change a file with future header expires you need to update your expires header code in your “.htaccess” file or the file will not show up as updated on your site it will stay the same. Place the following code under the “mod_deflate” code we did above:

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Expires "Wed, 21 May 2010 20:00:00 GMT"

You can if you want to add “js|css” to the file types but I do not suggest it as I did not do this to my “.htaccess” file.

Thats all for “.htaccess” tricks, now lets start on some more simple tricks.

Put CSS at the top and Javascript at the bottom.
Always make sure this is done, css at the top makes sure all the format and simple scripts are loaded first so your site doesn’t look weird while loading. Also put javascript at the bottom of the page so all the javascript won’t slow down your header and css from loading. Your visitors can wait .300 milliseconds for your javascript to load.

Make few http:// requests.
Don’t make so many requests for other domains. Do not put petty little link backs to myspace or your favorite youtube video. Put only about one blog ranking chicklet on your site if you have to, do not have an “Add To Any” chicklet on every single section on your web page. If you are a blogger and you like to have quick images in your posts to relate to the article, do not just copy and paste the image location. If it means so much to you to have an image upload it to your server. Try to have 95% of everything your site uses within one domain.

If you want more information feel free to email me or leave a comment I will get back to you!