A web log of Snat in this fucked up world!

Saving bandwidth

If you have ever ran a website, you may have ran into the issue in which you have ran out of bandwidth and either you get overcharged like hell or you get cut off. Well, lucky enough there are quite a few ways that you are able to save bandwidth and you can see quite alot of these being applied on Tweaked for your Pleasure. So here are Snat’s tips to being a cheap arse and saving bandwidth.

Compression

This goes without saying. Use compression. If you are using a major CMS or forum script, chances are you are able to just setup compression within the control panel. All you have to do is setup compression (such as gzip) and it will help you save bandwidth quite alot. There is a trade off in that this will use more CPU usage which may piss your web host off but in most cases it won’t.

Cache EVERYTHING

This one goes without saying. Cache everything you can such as all the images on your website. Most images on your website such as banners, logos and so fore will rarely change so get your user’s browsers to cache them. There is little point in keeping sending this to the same person over and over again as it is just a waste of bandwidth.

Load things externally

Alot of websites uses javascript and images and these things can always be loaded externally. Basically you use a free web host or even Google Sites to host your javascripts and images. Not only can this actually help with website load times but it will help you save bandwidth quite alot.

On Tweaked for your Pleasure, all images are actually loaded from images.snat.co.uk which is actually hosted on four different web hosting accounts and uses a round robin A record to randomly load it off one of them. You won’t believe how much bandwidth this saves and you can actually still save more bandiwdth.

The good thing about off-loading these is that you can keep adding new and new locations so as you grow you are able to still serve images and other objects without having to use your own website bandwidth.

Less Images

I am sure this goes without saying. The less images you have, the less bandwidth you use. Now quite alot of designers will use a small image as a background that even at times they will just use an image for a plain colour background. In this case you can simply just replace that image with CSS and this will save bandwidth.

Also, do you really need those 1000’s of images to create your design ?

Content delivery network

CDN is another way to help save bandwidth. Now you may be wondering that CDN only helps you serve content much more quicker but by using a free CDN known as The Coral Content Distribution Network that you are able to save yet more bandwidth. Coral CDN works very simply by adding .nyud.net to the end of any domain and instead of loading it directly from your server, it go use any local copy it has instead.

You may think this is bad as content would be the same and wouldn’t expire as quick as you may want but if you use these for images and stuff that rarely changes like CSS that you will notice a massive change in your bandwidth usage. This is what I do on Tweaked for your Pleasure.

All images on this website are loaded via Coral CDN and you may think for a second that this will have will cause a issue with your users then look below for an example. On Tweaked for your Pleasure, I uploaded a picture of Terra from Final Fantasy VI for the article Thank G-d for custom firmware and for some reason, this image is the most viewed image on the website. The image URL is: http://images.snat.co.uk/articles/ThankyouGdforcustomfirmware_EAE4/Terra.jpg

Now, when I do it via Coral CDN the image URL becomes: http://images.snat.co.uk.nyud.net/article/ThankyouGdforcustomfirmware_EAE4/Terra.jpg. Below I have the same image loading normally on the left and then I have the same image loaded via Coral CDN on the right. You will see there is no difference in loading them.

I hope this article was off help to some people in the quest to save bandwidth. Sadly, there are times where you will need to actually buy more but by using this tips, hopefully you may not have too for some time.

Mapping hostnames is easy. All you do is create an A record or a CNAME record to point to another webhost. You then use that webhost to host all the images which you then link too from images.yourdomain.