Answer the question
In order to leave comments, you need to log in
Why is File_get_contents too slow?
I use file_get_contens to work with STEAM, but almost immediately I ran into a very interesting problem:
$_MYKEY = "93291431A019B3FD12444E8377901C45";
$_MYID = "76561198018795706";
$Time = time();
$Response = file_get_contents("http://steamcommunity.com/profiles/".$_MYID."/inventory/json/570/2");
$Time2 = time();
echo '1 ='.($iTime2 - $iTime)."<br></br>";
$iTime = time();
$Response2 = file_get_contents("http://api.steampowered.com/IEconItems_570/GetPlayerItems/v0001/?key=".$_MYKEY."&format=json&language=ru&steamid=".$_MYID);
$iTime2 = time();
echo '2 ='.($iTime2 - $iTime)."<br></br>";
Answer the question
In order to leave comments, you need to log in
curl and multi_curl.
You can through wireshark, etc. to monitor what is stupid where.
Try to send the header (most likely you can add it via context):
Browsers are normally friendly with this, and file_get_contents() hangs until the timeout until it falls off.
You can try curl, send a request through a socket.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question