heyrocker / IfpaApi

A PHP wrapper class to simplify access the IFPA API
The Unlicense
5 stars 1 forks source link

Use curl instead of file_get_contents #4

Open haugstrup opened 10 years ago

haugstrup commented 10 years ago

file_get_contents() doesn't send a "Connection: close" header and instead waits 15 seconds to time out. Brian worked out the ssl certificate so there's no need to disable CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST

My simple tests shows requests going from 16 seconds to 0.7-0.9 seconds. :)

Details on the issue at hand: http://stackoverflow.com/questions/3629504/php-file-get-contents-very-slow-when-using-full-url