i am working on route api. In this api, i need to pass huge geocode data in my POST polyline parameter(nearly 1 mb in size).For testing purpose, we added "hello world" in our response file and nothing else.i am getting 3.1 sec as response time.This is due to polyline parameter which is taking 3 sec to send its value(nearly 1 mb in size). I even added gzip then also response taking same time(3 sec). Please help me to optimize curl so that i can get response in milliseconds.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_URL, "http://example.com/");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array("polyline"=>"37.779381,-122.418435,37.779381,-122.418435,37.779153,-122.418391...."));
curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
$curl_exec = curl_exec($ch);