note 56049 modified in function.fsockopen by vrana
| From: | vrana@php.net | Date: | Thu, 04 May 2006 13:32:12 +0000 |
| Subject: | note 56049 modified in function.fsockopen by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-110517@lists.php.net to get a copy of this message | ||
I have found, when using fsockopen() and the POST method, that using HTTP/1.1 is VERY significantly
slower than HTTP/1.0 (at least for the server I'm querying, an Orion-based server). Also, using
cURL tended to be faster than fsockopen(), though only slightly. For example, here was a recent set
of data (for the same exact request in each case):
cURL: 4.2sec
fsockopen() HTTP/1.0: 4.9sec
fsockopen() HTTP/1.1: 19.9sec (!)
I'm not sure why this was occurring. Perhaps it has something to do with the Orion server,
which I have little experience with. However, it was not a fluke, and I double-checked the code to
make sure there were no errors.
EDITORS NOTE: HTTP/1.1 uses persistent connection causing this delay. Use "Connection:
close" header to disable it.
--was--
I have found, when using fsockopen() and the POST method, that using HTTP/1.1 is VERY significantly
slower than HTTP/1.0 (at least for the server I'm querying, an Orion-based server). Also, using
cURL tended to be faster than fsockopen(), though only slightly. For example, here was a recent set
of data (for the same exact request in each case):
cURL: 4.2sec
fsockopen() HTTP/1.0: 4.9sec
fsockopen() HTTP/1.1: 19.9sec (!)
I'm not sure why this was occurring. Perhaps it has something to do with the Orion server,
which I have little experience with. However, it was not a fluke, and I double-checked the code to
make sure there were no errors.
http://php.net/manual/en/function.fsockopen.php