I have a curl request and usually the webservice I connect takes 8 seconds to return a json of 600,000 lines. The problem is when I open a tab to make this request eg link is if this tab is still loading and I try to open another one in the same domain: link or link it does not open until php is done do the curl.
Does anyone know how to solve this?
My code:
$servidor = "http://localhost:8080/ws/v1/http/servico/disponibilidade";
$content = str_replace('{idHotel}', $input['idh'], $jsonServ);
$ch = curl_init($servidor);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($content),
'Accept: application/json')
);
$result = curl_exec($ch);
echo $result;
I need to make it possible to do two simultaneous searches on two or more tabs.