Jump to content

Inlcuding Classes - Web page load time?


magnetica

Recommended Posts

Hi All

 

Consider the following script where the 'file_containing_class.php' is say 50kb in size but $name only uses a portion of the file that is say 1kb

 

require_once 'file_containing_class.php'
$class = new Class;
   //$namewould be something like Tom etc
     $name = $class->getName();

 

Does the user have to download the whole php file or just the part that is being called?

 

So here would the user download the whole 50kb or just the 1kb being called?

 

Thanks, Magnetica

Link to comment
Share on other sites

Ok thanks.

So the user wouldn't directly download the php file.

 

php would however read the whole include/require file on the server.

 

So would the user still have to wait for the server to download and read the whole file?

 

Or does the file not have to download it but just find it?

 

Thanks,  Magnetica

Link to comment
Share on other sites

If you're including a local file it doesn't have to be downloaded at all. It just had to be read by PHP. The difference between including a 1kb and 50kb file won't be noticeable.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.