Will file_get_contents increase my server bandwidth

Discussion in 'PHP' started by vaakash, May 16, 2009.

  1. #1
    Hello,

    I am currently doing a project. The project is i will serve flash rss reader to users.
    In flash there are security restrictions and one can't load xml file directly from another website.
    So i prepared to used PHP to load xml files from another server. And this also worked well !.

    My php file contains the following code


    <?php
    $rssfile = file_get_contents($_GET['rss']);
    echo $rssfile ;
    ?>
    PHP:
    My question is when i load and xml file will it increase my server bandwidth ?
    When thousands of people use my rss reader, thousands of rss files will use my php file and load their required xml file.

    When this happens will there be an increase in my server bandwidth ?

    If it will increase suggest anyother php scripts which will fullfill my needs.

    Thanks
     
    vaakash, May 16, 2009 IP
  2. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #2
    When googling, most results say yes, so I presume so.
    I don't think there is any different way to do this without using any bandwidth.
    cUrl would be another option, but that also eats bandwidth.
     
    Sky AK47, May 16, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    Yes coz to open and read the file it is going to transfer data
     
    Bohra, May 16, 2009 IP
  4. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Any kind of traffic/transfer coming into the server or out of the server consumes your bandwidth.
     
    kblessinggr, May 16, 2009 IP
  5. vaakash

    vaakash Member

    Messages:
    127
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #5
    Thanks for your suggestion . After reading your replies i decided to host the php file on a free hosting server .

    I came across Zymic, X10Hosting and many other but they are not supporting these kinds of scripts. They say "function disabled by the server".

    I googled to find any reliable and free hosting server but i was not.

    Please post any links about any free hosting server which will fulfill my needs.
    Thanks in advance !!
     
    vaakash, May 16, 2009 IP
  6. Sky AK47

    Sky AK47 Member

    Messages:
    298
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    45
    #6
    You can always use Dreamhost, which gives you 'unlimited' bandwidth. I don't believe it's unlimited, but I already used up to 400GB bandwidth with them and they aren't really expensive.
     
    Sky AK47, May 17, 2009 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    Wouldn't it be possible to reduce bandwidth-usage here? If you load the XML into a database, and then lookup info there for generating the RSS-feed? The RSS-feed itself isn't continous - it updates at intervals you can set in the RSS-code, and therefore it will won't create new feed items everytime someone requests the RSS-file - it will just send the current status each time, until new content is fetched (if I've understood this correctly). Anyhow, caching the content, and for that matter, the RSS-feed, would greatly decrease bandwidth usage, I would imagine.
     
    PoPSiCLe, May 17, 2009 IP
  8. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #8
    Most free or paid web hosts will not look kindly at you signing up just to do this. Free web hostings have file_get_contents disabled by default because it is a huge resource hog and a lot of times it will run up the cpu usage on a server, because the server no longer is a server. It turns into a browser of sorts. Before signing up any place you should email or live chat with someone either in sales or support and ask if you can do this. So, at least you will have it in writing.
     
    exodus, May 18, 2009 IP