1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to reduce bandwidth usage for a site?

Discussion in 'Apache' started by westhaven, May 29, 2005.

  1. #1
    how to reduce bandwidth usage for a site?
     
    westhaven, May 29, 2005 IP
  2. compar

    compar Peon

    Messages:
    2,705
    Likes Received:
    169
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Reduce code bloat, the number of graphics used, and run your images through some optimizer to reduce their size.

    Of course you could also hide the site so nobody could find it. That would reduce the bandwidth used :D
     
    compar, May 29, 2005 IP
  3. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is a pretty handy tool to see what's big an what's not.

    http://www.websiteoptimization.com/services/analyze/

    Use one-line-per-element CSS rules; use shorthand CSS properties (e.g. font instead of font-family, font-size, etc); use palette-based images where possible (PNG or GIF). Avoid using deprecated HTML (font, valign, etc). Share stylesheets and scripts instead of duplicating them on every page.

    J.D.
     
    J.D., May 29, 2005 IP
  4. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #4
    westhaven, May 30, 2005 IP
  5. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #5
    Do what they comment above:

    You html code could be much better optimized (css based using shorthands)
    Optimize your images: checking your main page I see that at least you can save a few kb. If you have a lot visitors (that's why you want reduce bandwith right?) you'll save a lot.
    Send your html gzip compressed when possible.
     
    tresman, May 30, 2005 IP
  6. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You an also block some of the bandwidth hog spiders that don't actually do you any good
     
    yfs1, May 30, 2005 IP
  7. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Or block visitors per country.
     
    crazyhorse, May 30, 2005 IP
  8. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Compress HTML
     
    crazyhorse, May 30, 2005 IP
  9. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #9
    By the way, Why do you want to reduce bandwidth? Are you finding it that expensive?

    I'm always just curious because every site I have, when the bandwidth increases so does the revenue so its never been seen as an issue.
     
    yfs1, May 30, 2005 IP
  10. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #10
    the reason of increasing bandwidth is my site is getting more n more visitors and robots.But there is no increment in revenue.
     
    westhaven, May 30, 2005 IP
  11. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #11
    i have mailed you the zipped file for my site www.cash-for-surveys.com
     
    westhaven, May 30, 2005 IP
  12. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #12
    Hi,

    I got your email. Sorry for the missunderstading but with "Send your html gzip compressed when possible" I meant:

    use
    php ob_start ("ob_gzhandler") 
    
    Code (markup):
    that sends the html compressed to brownsers that accept gziped html and uncompressed to those that do not.

    I am sorry but I doubt I have time to redesign your site. However, I will go now with some more explained tips that I hope could help (and btw, this time there will be no missunderstanding by replying so quick).

    A)Use PHP to compress the HTML:

    Use .php in your files or tell your server to parse html. Then, at the very top of every page put
    <?php
    ob_start( 'ob_gzhandler' );
    ?>
    
    Code (markup):
    Please note that this option has to be available on your server.

    B)Redesign the site: to much tables, its a "tag soup". Code like this

    <BODY BGCOLOR=#FFFFFF background="images/turquoise.gif" tppabs="http://www.cash-for-surveys.com/images/turquoise.gif" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
    Code (markup):
    and like this
    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FF6600">
    Code (markup):
    has to be dowloaded everytime you visit the site. This could be avoided by doing a good use of (x)html and css. But that's to long. Personally I think you need to rebuild from scracht.

    C)Optimize you images: by using photoshop the image bulina.gif went from 3.22kb to 1.73kb and I really didn't notice the difference on its quality. Also, lg_casro.gif wen from 4.97kb to 2.87kb.

    Also, if you can, get ride of unnecesary images. Is the visitor counter strictly necessary? That big? could it be text based?

    The banner at ./images/banners/800x60/03.gif is 32kb. Work on it.

    D) You have to determine where the bandwith usage comes from. If they are bots, you can block via .htacces. Following the list I use:

    RewriteCond %{HTTP_USER_AGENT} (BlackWidow|Crescent|Disco|ExtractorPro|Franklin|Harvest|HLoader|NetZIP|NICErsPRO|NPBot|PlantyNet_WebRobot|Teleport|TurnitinBot|VoidEYE|WebBandit|WebCopier|Websnatcher|Zeusattach|BackWeb|Bandit|tchFTP|Buddy|ChinaClaw|Collector|Copier|Bot\mailto:craftbot@yahoo.com|DISCo\Pump|Download\Demon|Download\Wonder|Downloader|Drip|eCatch|EirGrabber|Email|Express\WebPictures|ExtractorPro|EyeNetIE|GetRight|GetSmart|Go-Ahead-Got-It|gotit|Grabber|GrabNet|Grafula|HMView|HTTrack|InterGET|Internet\Ninja|InternetSeer.com|Iria|JetCar|JOC|JustView|LeechFTP|lftp|likse|Magnet|Mag-Net|Mass\Downloader|Memo|MIDown\tool|Mirror|Mister\PiX|Navroad|NearSite|NetAnts|NetSpider|Net\Vampire|NetZip|Ninja|Octopus|PageGrabber|Papa\Foto|pcBrowser|Pump|Reaper|Recorder|ReGet|Siphon|SiteSnagger|Snake|Stripper|Sucker|SuperBot|SuperHTTP|Surfbot|tAkeOut|Teleport|vayala|Vacuum|VoidEYE|Web\Image\Collector|Web\Sucker|WebAuto|WebCopier|WebFetch|WebReaper|Website|Webster|WebStripper|WebZIP|Wget|Whacker|Widow|Xaldon) [NC,OR]
    Code (markup):
    (more can be added or removed depending on your situation).

    D.2) IF you traffic comes from normal bots like MSN or Slurp, try to use some metas like "revisit after..."

    E) Sure you need some of these meta-tags (abstract, timestamp, and that many keywords"? Check them to, not many but few bits can be saved.

    You have some work now to do.

    Personally, I would reccommed to learn how to use css. Or to find a host that gives more bandwith at a good rate.

    Hope I helped. Also if someone sees any mistake above please post, so it will help me to.
     
    tresman, May 30, 2005 IP
    compar and Smyrl like this.
  13. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #13
    thanks for giving me such a useful information TRESMAN
     
    westhaven, May 30, 2005 IP
  14. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #14
    <?php
    ob_start( 'ob_gzhandler' );
    ?>

    what does it do? how can this code help me out.
     
    westhaven, May 30, 2005 IP
  15. jorge

    jorge Peon

    Messages:
    202
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #15
    gzip is THE solution, works great
     
    jorge, May 30, 2005 IP
  16. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #16
    <?php
    ob_start( 'ob_gzhandler' );
    ?>

    This code starts a php function that, basically, does the following:

    Your server: "Hello Browser, do you accept gzip?"
    Brownser: "Yes, I do, give me it compressed"
    Your server: "Ok, here you have"

    ...

    Brownser: "No, I do not. What are you talking about?"
    Your server: "Doesn't matter, just have the normal version"

    Basically, what is does is send the data (the text, not images) compressed. More explained:

    If the browser understand compressed date, your server comprress the html (like zipping it), sends it, and the browser uncomppres (unzip) the data and then displays it.

    This means more CPU usage on the server, but less bandwith wasted.

    I have not posted many times so I suposse I can not put live links here, but yuo can check your page wit the tool at pipeboost.com and it will give an indication on how much you can save.

    Also, note that pages will load more quickly. Note too that old browsers will receive the page as they used. And finally, some people says that there have been problem with Netscape 4 crashing. But do you still care about Netscape 4?
     
    tresman, May 30, 2005 IP
    Bernard likes this.
  17. Design Agent

    Design Agent Peon

    Messages:
    3,061
    Likes Received:
    154
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Unlimited bandwith hosting + domain name = about $75 pa - The time it takes to optimize everything, it might be easier to change hosts.
     
    Design Agent, May 30, 2005 IP
  18. tresman

    tresman Well-Known Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    138
    #18
    You are totally right and it has been suggested before, but the question was "how to reduce bandwith".

    You can have unlimited bandwidth at a nice rate, and optimizing everything is a hard work, I agree.

    But a litle bit out of the topic: optimizing the page makes it dowload faster. So maybe next time, he begins doing it the right way giving therefore users a better experience. And BTW, future maintenance of the site will be easier trough CSS.
     
    tresman, May 30, 2005 IP
  19. westhaven

    westhaven Well-Known Member

    Messages:
    3,936
    Likes Received:
    452
    Best Answers:
    0
    Trophy Points:
    195
    #19
    thanks trsman let me try it then i will get back to you
     
    westhaven, May 30, 2005 IP
  20. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Another way to reduce traffic is to turn on content expiration. That is, with every response, HTTP server will send either an Expires and/or Cache-Control header that will instruct browsers/proxies to cache files served this way for the amount of time specified in either of these directives. The next time the page is requested, the browser will not request these files. It usually is a good idea to allow content to be cached for at least an hour and sometimes it can be a day or even more, depending on how your website is being used. Here's more info on this:

    http://httpd.apache.org/docs-2.0/mod/mod_expires.html

    I usually enable expiration for all images, stylesheets and client-side scripts.

    J.D.
     
    J.D., May 30, 2005 IP