« Today’s Nice Posting Of My Blogwalking - Beware of Cookies »

Conserving Bandwidth

11 April 2007

bandwidth

Bandwidth limitation is this Blog's problem. I was not expecting for a huge web traffic coming just overnight which could drag my bandwidth near to it's limit. Well it's not yet happened but I must aware about it's possibility.

Several days ago, on 5th April to be exact, I receive a short exposure on StumbleUpon. I didn't even notice which article was gaining that short exposure since I can't trace that back on StumbleUpon. It was a very short appearance I guess. I knew about it later when I checked my cache on Google and I saw a wrong image appeared on this page. Then I checked my visitor's statistic just to realized that I received a surge of web traffic coming from StumbleUpon.

This surge of visitors remind me to optimize this Blog's file size even more. The main page size is around 107 KB at the moment. This means my bandwidth will be used up after 10.000 hits only on the main page. Because I have only 1 GB data transfer limit for each month, I was hoping that this amount is enough to serve My Daily Thoughts at the beginning. However the recent increasing of visitor number push me to think again how to reduce data transfer from my web server. To optimize data transfer, I use several method.

Image Optimization

Our Blog themes is the first priority for optimization. Background image or Header Image has potential to create a huge data transfer from your server. Try to change those images mode into indexed color and you could conserve up to 30% data transfer for each image. You can use Image editor software to do that. RGB color mode is nice but it gives you a bigger file size than indexed color without significant difference of it's appearance on your monitor. You need the RGB color mode only for printing purpose. Don't forget to use image compression when saving your images.

You can host your images on another server. For example I use Imageshack to host several images. For WordPress user there is a nice plugin for image uploading directly to Imageshack from your wordpress editor. Another option is hosting your images on Googlepages since it gives you 100 MB space for free and allow user to hotlink images.

However if you host images on different place, it will increase loading time on visitor's side since your page making call to another place to load images. Well you can consider which factor is more important for you the amount of data transfer or the loading time. Both has it's own consequences.

Use Gzip compression option.

wordpress

Many new web browser support gzip data transfer to optimize file transfers over the Internet network. Before transferring data, your web browser asked the server whether it has gzip file or not, if available then gziped html file will be transfered to your computer. Apparently gzip type of file has smaller size than it's original html. WordPress fortunately has option to activate or de-activate gzip file transfer, then use this generous option to conserve your bandwidth. At your admin panel go to Option >> Reading then scroll down page until you see "WordPress should compress articles (gzip) if browsers ask for them" activate this option and click Update Option.

If you use WP-Cache on your WordPress installation, Gzip option is by default not supported. You have to de-activate this option before using wp-cache. But there's always a way out for this problem. You only need to add a line of code on wp-cache-phase1.php.

Open wp-cache-phase1.php with your text editor, find
foreach ($meta->headers as $header) {
on line 36. Then add
if ( extension_loaded(’zlib’) ) ob_start(’ob_gzhandler’);
before that line. So it will be

CODE:
  1. return;
  2. if ( extension_loaded(’zlib’) ) ob_start(’ob_gzhandler’);
  3. foreach ($meta->headers as $header) {
  4. header($header);

Save it and upload to your wp-cache plugin's folder on your server. It will cache your text but gziped it first before delivering.

Reduce the amount of text

I consider to reduce the amount of text in my main page, since it will reduce the html file size. Instead of showing all of my long posting on the main index I like to use a teaser for every post. In Wordpress you can add <!--more--> to cut your long post from appearing on main page. Let your visitor get the first impression before deciding to read more of your post. It could make your visitor stay a little longer on your site by navigating deeper.

Well at least I have use those option to optimize My Daily Thoughts. If you have more Idea on this issue please share it on comment form below.

Image source: http://aptgetanarchy.org/taxonomy_menu/7/23 and http://www.hermann-uwe.de/taxonomy/term/694

Posted On , ,

Share This

Related Posts

Random Posts

U COMMENT
I FOLLOW

One Response to ' Conserving Bandwidth '

Subscribe to comments with RSS or TrackBack to ' Conserving Bandwidth '.

  1. wira said,

    on September 5th, 2007 at 12:58 pm

    follow of my experience about image optimization, put text your title post on alt image. and than on end your post, you can write like a a title. Try..

Leave a reply

Search terms for this post   bandwidth (1),