PDA

View Full Version : Use relative path


neverdone
02-17-2005, 01:24 PM
In the past project I use path for a picture with an absolute path such as <img src="<?php echo $DOCUMENT_ROOT;?>/mypicture/ia.jpg"> , the page loads very slow as it generates almost 20 thumbnail. Then I tried to use relative path such :<img src="../mypicture/ia.jpg">. I found that, pages loads faster almost twice than before ..
Share your thoughts about that ..
_________________________
free ebook programming (http://www.free-itebooks.com/) | garden teak furniture (http://www.ascaryafurniture.com/)

jerry187
02-20-2005, 10:31 AM
how are you measuring this speed.?? milliseconds processing time within your script or just guessing???

iDxMan
02-20-2005, 11:06 AM
Yeah, how was measured and did you clear your browser cache?

-r

Silmaril8n
02-20-2005, 04:22 PM
It shouldn't decrease the speed that much but the first method does take extra and needless PHP parsing.

Viper007Bond
02-20-2005, 10:08 PM
Much easier/better to let the browser figure out where the image is.

Mr. Popularity
02-21-2005, 12:54 AM
Just a quickie note to make things easier for you...

instead of:<?php echo $DOCUMENT_ROOT;?>
try this:<?=$DOCUMENT_ROOT?>

Same thing :D