View Full Version : Will file_get_contents increase my server bandwidth
vaakash
May 16th 2009, 7:19 am
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 ;
?>
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
Sky AK47
May 16th 2009, 10:57 am
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.
Bohra
May 16th 2009, 11:19 am
Yes coz to open and read the file it is going to transfer data
kblessinggr
May 16th 2009, 11:40 am
Any kind of traffic/transfer coming into the server or out of the server consumes your bandwidth.
vaakash
May 16th 2009, 10:19 pm
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 !!
Sky AK47
May 17th 2009, 1:39 am
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.
PoPSiCLe
May 17th 2009, 6:47 pm
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.
exodus
May 18th 2009, 5:19 am
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.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.