PHP transfer data between 2 remote servers, what is fastest way?
<p>I have Server A and Server B which exchanges some data. Server A on user request pull data from Server B using simple file_get_content with some params, so server B can do all task(database etc) and return results to A which formats and show to user. Everything is in PHP.</p>

<p>Now I am interested what is fastest way to to this? I made some test and average transfer time for average response from server B at (~0.2 sec). In that 0.2 sec, 0.1 sec. aprox. is Server B operational time (pulling data calling few databases etc) what mean that average transfer time for 50kb with is 0.1 sec. (servers are NOT in same network)</p>

<p>Should I try with:</p>

<ol>
<li>cURL insted of file_get_content ?</li>
<li>Or to try to make whole thing with sockets( I never work work with sockets in PHP but I supose that easily can be done, on that way to skip web server )</li>
<li>or something third?</li>
</ol>

<p>I think that time can be 'found' on shortening connection establishing, since now, every request is new connection initiating (I mean on separate file_get_content calls, or I am wrong?)</p>

<p>Please give me your advices in which directions to try, or if you have some better solution I am listening.</p>
