File parsing causing latency

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
FredEH
Forum Newbie
Posts: 18
Joined: Fri May 09, 2003 8:39 am

File parsing causing latency

Post by FredEH »

Hi,

I have been having a problem with my website loading VERY slow. By trial and error, I was able to find that any time I use code like this:

Code: Select all

<?php
$include = 'http://www.whatever.com/header.php';
$include_output = implode('', file($include));
?>
My site bogs way down. Could this be a problem with my host? Or is this a common problem when using this type of code

Thanks in advance
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

depends on the size of the document, the time it takes to contact the other site and the transfer bandwidth.
FredEH
Forum Newbie
Posts: 18
Joined: Fri May 09, 2003 8:39 am

Post by FredEH »

What if it is the same site and its just a small header file?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

then why do you read it via http?
FredEH
Forum Newbie
Posts: 18
Joined: Fri May 09, 2003 8:39 am

Post by FredEH »

Well... because i'm using it for my phpbb and the header file is not in a relative path.
Gleeb
Forum Commoner
Posts: 87
Joined: Tue May 13, 2003 7:01 am
Location: UK
Contact:

Post by Gleeb »

All paths on the same physical server are relative. don't forget about ..
Post Reply