Reputation: 243
If I write:
$mypage=file_get_contents("www.mywebsite.com/mypage.htm");
The first time I run the script, file_get_contents() will surely make a HTTP request to www.mywebsite.com for mypage.htm, and get a response with the content of mypage.htm.
But every next time I run the script, will file_get_contents() get the real file on www.mywebsite.com? Or it has some kind of cache on the localhost?
Upvotes: 1
Views: 3132
Reputation: 46728
It does not. However, there will be a speed-up because the DNS resolution step may be faster on subsequent tries (till the cached entry expires), as the DNS records are cached by the server's OS.
Upvotes: 3