Web Hosting Talk







View Full Version : Performance difference using PHP includes from file system instead of remote call?


beet
06-30-2004, 02:05 PM
Hi,

I'm just wondering whether theres a performance degredation when a URL is passed to the include() function, rather than using a system path to the file.

<?PHP include("http://YOURSITE.com/test.txt"); ?>

Or

<?PHP include("/test.txt"); ?>

I'd like to think that when you request a file from your site wih the http prefix, it would involve an additional apache process to handle it, whereas including a file via a path name would not.

Also, the reason I even use a remote call to my own server, was the fact that using the path to a file sometimes gave me problems showing up ; with a URL, it always displayed.

CrZyAsMHaCkeR
06-30-2004, 04:55 PM
On my box it takes about between 0.01 to 0.05 seconds longer to include using http://.../ format than .../ (system path) format. So it appears that PHP does indeed use an additional http process to deal with it on the same site. This is coming from PHP/4.3.4

Burhan
06-30-2004, 05:07 PM
Also, using URLs won't work if url_fopen is disabled on your server.

beet
06-30-2004, 09:11 PM
Interesting, thanks for the info.

I'll test without the remote call and see if my http process do go down.