title: Why is relative URL faster in PHP file_get_contents?
body: <p>I use PHP and <a href="http://se2.php.net/function.file-get-contents" rel="nofollow">file_get_contents</a>. It was really slow even when I tried to speed it up with this:</p>
  
  <pre><code>$opts = array(
      'http'=&gt; array(
      'header' =&gt; 'Connection: close'
      )
  );
  $context = stream_context_create($opts);
  $contents = file_get_contents('http://www.example.com/file.txt', false, $context);
  </code></pre>
  
  <p>I also tried <code>cURL</code>. Same issue.</p>
  
  <p>I've read that <code>include</code> should be slower than <code>file_get_contents</code>. That seems only to be true when NOT including the whole URL but including the relative path, like this...</p>
  
  <pre><code>file_get_contents('../file.txt');
  </code></pre>
  
  <p>My question is... Why is the relative path much faster than the full URL?</p>