BrizRobbo Posted June 25, 2008 Share Posted June 25, 2008 Hi Folks, I'm using the file_get_contents function to retrieve the contents from a URL. Something like: <?php echo date('h:i:s')."\n"; //TIMESTAMP -START $contents = file_get_contents("http://lasun122/index.html"); print "$contents\n"; echo date('h:i:s')."\n"; //TIMESTAMP -END print "FINISHED\n"; ?> It gets all the contents of that URL successfully, then prints it out successfully. The time between the 2 timestamps is typically less than 1 second. However, there always is about a 5 second delay before the program finishes and I get back to the shell prompt. It doesn't matter what web server I'm trying to hit, the delay is always there. Does anyone have any idea what might cause this delay? Cheers. Link to comment https://forums.phpfreaks.com/topic/111755-delay-when-retrieving-url-using-file_get_contents/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.