1

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?

pane619
  • 243
  • 3
  • 11

1 Answers1

3

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.

Anirudh Ramanathan
  • 46,179
  • 22
  • 132
  • 191