Is there a faster way to include PHP files?

969 views Asked by At

I have the following code when I want to include some code from another PHP file:

$domain = 'www.example.com';
require_once $domain.'/footer.php');

I wonder though if this is slower than it could be, because surely this then has to go through a DNS to find the page?

Is there a quicker way to do this? Maybe I should set my IP as $domain? Or maybe there is some PHP snippet that will detect it for me?

I also pay for DNS hits, so there's that too...

1

There are 1 answers

0
Richerd fuld On BEST ANSWER

No thought You can include file via autoloader but there is no other way to include files than

Require and include in php and both are fast, even if you use temples it would be same.