Does PHP filesize affect bandwidth

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
jimthunderbird
Forum Contributor
Posts: 147
Joined: Tue Jul 04, 2006 3:59 am
Location: San Francisco, CA

Does PHP filesize affect bandwidth

Post by jimthunderbird »

Hi All,
I have a php with around 2000 lines of code, it's a big class with around 80 utility method.
If I use include_once to include this big file, will it affect bandwidth?
Thanks for your help.

With my best,
Jim
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Does PHP filesize affect bandwidth

Post by volka »

jimthunderbird wrote:If I use include_once to include this big file, will it affect bandwidth?
Yes, of all media that is used to load the file.
But if you load the file from the local filesystem you probably do not have to pay for it ;)
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

No. Only output/input between client and server (and other servers, if you use them) effect bandwidth.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Despite what the URL says, your browser never sees a PHP file. What your browser sees is the output from that PHP file. So, the size of the PHP file is irrelevant - only it's output matters.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post by MrPotatoes »

so make your output neat, tidy and small :)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Jenk wrote:No. Only output/input between client and server (and other servers, if you use them) effect bandwidth.
depends on what you call "bandwidth" ;) Of cause include 'xyz.php'; uses the bandwidth of my pc's s-ata adapter.
But yes, access to the local filesystem does not create payload on the network adapter.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Imho the script, nor the output it generates have an influence on your internet connection bandwidth (but they may be related to my defintion of bandwith.).
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://en.wikipedia.org/wiki/Bandwidth wrote:Bandwidth is related to channel capacity for information transmission and is often confused with it. In particular, in common usage "bandwidth" also refers to data (information) transmission rates when communicating over certain media or devices.
I can live with beeing common ;)
but will keep the inaccuracy in mind
Post Reply