Link to home
Start Free TrialLog in
Avatar of greenbug2000
greenbug2000

asked on

Speeding up php includes

hi i have a pice of code like this:
<?php


include 'http://www.sight.com/coachv4.php?coach=W';
include 'http://www.sight.com/coachv4.php?coach=X';
include 'http://www.sight.com/coachv4.php?coach=A';
include 'http://www.sight.com/coachv4.php?coach=B';
include 'http://www.sight.com/coachv4.php?coach=C';

?>

which works fine and preduces the tables created by coachv4.php fine 5 times but this is mutch slower at appering on screen (about 20 seconds) than when each item is calld separatly in internet explorer (<2 secs) i am shure there must be a way to loop the instruction over several times changing the veriable coach each time avoiding combining the entire file 5 times with sutch minor changes into a monster file

thanks for you help
Avatar of prsupriya
prsupriya

Hi!

Is sight.com an external URL?

S:
Avatar of greenbug2000

ASKER

no but i need the html generaded by the php when its run in a browser not the php veriables etc
use a series of iframes rather loading them all as includes if this is causing load time problems

more likely, the source of your problem is malformed HTML or at least HTML that IE has no fun trying to render. (e.g. nested tables)

with nested tables in IE, the rendering won't begin until the last </TABLE>
ASKER CERTIFIED SOLUTION
Avatar of Promethyl
Promethyl
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did this answer help you?
<?
ob_start("ob_gzhandler"); // compress page ; faster

$pages = array ('http://localhost/coachv4.php?coach=A','http://localhost/coachv4.php?coach=B',
'http://localhost/coachv4.php?coach=C','http://localhost/coachv4.php?coach=Z');

foreach ($pages as $page) {
   $blackhole = file_get_contents($page);
}

 /* Regulation page stuff*/
?>

Also, if you have control of the server, consider a memory-based caching program, such as mmcache, eaccelerator or Zend's solution Zend Optimizer + Zend Optimizer.