Page 1 of 1

does readfile() take lots of resources?

Posted: Sun Mar 13, 2005 12:05 am
by hongco
Hi,

Many users here mention about using readfile() in order to protect their files from leeching? Would readfile take more resources (bandwidth)? example, if i wanted to play a song with mp3 format, which one will result in more bandwidth use: using the Embed tag or readfile()?

Thanks! :D

Re: does readfile() take lots of resources?

Posted: Sun Mar 13, 2005 1:56 am
by infolock
hongco wrote:Hi,

Many users here mention about using readfile() in order to protect their files from leeching? Would readfile take more resources (bandwidth)? example, if i wanted to play a song with mp3 format, which one will result in more bandwidth use: using the Embed tag or readfile()?

Thanks! :D
as far as bandwidth goes, you aren't actually going to see a difference.. as far as resources goes, it's according to how big the file is and how big memory_limit is set to as it will only allow file sizes that match the maximum value of memory_limit.

Posted: Sun Mar 13, 2005 4:12 am
by hongco
Thanks infolock!

The readfile function takes the whole file into memory at once.

How does the html embed tag works when embedding mp3 file? does it load the file onto the client as temp file? if this is true, would this help reduce resource on the server which hosts the mp3 file?

Thanks again!

Posted: Sun Mar 13, 2005 10:13 am
by feyd
the server must still transfer the file no matter what.. so it wouldn't really affect anything I'm aware of.

Posted: Sun Mar 13, 2005 11:26 am
by hongco
thanks feyd