Web Host: Bandwidth Conservation Measures

By Kathy · Feb 23, 2004 ·
  1. Kathy
    Bandwidth Conservation Measures

    Here's a few things that you can do to your forum (regardless of what software it is) to save on bandwidth.

    - GZIP

    If you have a GZIP feature in the AdminCP, enable it and set it to level 1. Make sure your server has GZIP installed. This will save quite a lot of bandwidth.

    If you have access to your server shell, install mod_gzip for your entire server. (Be sure and turn *off* the gzip in your vbulletin control panel though. Do not have them both enabled).

    - Cut down on images.

    The main image to cut down first is the top banner. It is viewed on every page and for most forums, it is usually over 30kb, in some cases around 100kb! The best thing to do is design a header to your forum that doesn't require an image of that size; try just having a small logo of around 15kb at the most. This will save significant bandwidth. Other images to cut down on are for example the post images, such as the buttons linking to the homepage of the user, pm link, email link, search posts link, and so on. If you make these text, a lot of bandwidth will be saved, if you have a large forum, you may not realise it but these few little buttons do add up the bandwidth.

    We know that some webmasters love to load up a site with gorgeous graphics taking talent and energy to create in photoshop. Be aware, however, that all those graphics are loaded into the page with every visit of every visitor and with every page read. It all adds up!

    - Create a 'lite style'

    Set the more graphical style as an option for premium members or subscribers or something. The lite style should be low on images and such, therefore not only is it good for 56k users, but is also less of a burden on your bandwidth.

    - Block spiders from specific area of your site

    One of the simplest fixes to reducing bandwidth overheads is to use a robots.txt file to block spiders from specific areas of your forums.

    The simplest would simply block spiders from your images - other forms would block entire areas of your forums from spiders...but more for reasons of channelling PR to your content - for search engine optimisation purposes - rather than to simply save on bandwidth. :)

    In case anyone is curious, this is an example robots.txt file to block spiders accessing your graphics:

    Code:
    User-agent: *
    Disallow: /forum/images/
    
    And this is an example of a robots.txt used to focus PR into your thread content:

    Code:
    User-agent: *
    Disallow: /forum/attachment.php
    Disallow: /forum/avatar.php
    Disallow: /forum/editpost.php
    Disallow: /forum/member.php
    Disallow: /forum/member2.php
    Disallow: /forum/misc.php
    Disallow: /forum/moderator.php
    Disallow: /forum/newreply.php
    Disallow: /forum/newthread.php
    Disallow: /forum/online.php
    Disallow: /forum/poll.php
    Disallow: /forum/postings.php
    Disallow: /forum/printthread.php
    Disallow: /forum/private.php
    Disallow: /forum/private2.php
    Disallow: /forum/report.php
    Disallow: /forum/search.php
    Disallow: /forum/sendtofriend.php
    Disallow: /forum/threadrate.php
    Disallow: /forum/usercp.php
    Disallow: /forum/admincp/
    Disallow: /forum/modcp/
    Disallow: /forum/images/
    Disallow: /forum/sendmessage.php
    Disallow: /forum/register.php
    Disallow: /forum/subscription.php 
    
    
    A robots.txt file is nothing more than a text file of that name, dropped into your main HTML root folder. Most reputable spiders will obey it.

    -Prevent Hotlinking by others

    Check through your domain logs and look for excessive image usage and follow the links if they indicate your images are showing up on other websites. This can easily be stopped by adding an .htaccess file to the root directory, making sure that no domain other than yours can view your images.

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://domain.com/.*$     [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.domain.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://12.34.56.789/.*$ [NC]
    RewriteRule \.(gif|jpg)$ - [F]
    
    Be sure and replace "domain.com" with your own.

    Take precautions to protect your bandwidth and save on webhosting costs monthly.


    Thanks to N9ne and Brian Turner for submitting info regarding bandwidth.

    Share This Article

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.