Does Zend_Http_Client support http pipelining?

View: New views
2 Messages — Rating Filter:   Alert me  

Does Zend_Http_Client support http pipelining?

by Steven-81 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Quick question, couldnt really figure it out from the manual - does
Zend_Http_Client support pipelining (sending get multiple requests to
the same host in one packet) ?

I note the use of the Keep-Alive header, but am unsure of how to add
multiple paths to the same request instance, and then how the response
will be formated. Any tips appreciated.

Cheers,

Steven

Re: Does Zend_Http_Client support http pipelining?

by Shahar Evron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

It doesn't look like this have been answered, so I'll give it a shot.

I'm not entirely sure what "pipelining" is. You can set the keepalive =>
true configuration option to keep the connection open between requests
of the same Zend_Http_Client object.

Something like:

<?php

$client = new Zend_Http_Client('http://example.com/1.html',
array('keepalive' => true));

$res1 = $client->request();

$client->setUri('http://example.com/2.html');
$res2 = $client->request();

?>

Now you have the two responses in $res1 and $res2 - and the connection
should not have been closed between them (if supported by the server of
course).

Shahar.



On Wed, 2008-03-19 at 13:25 +0000, Steven wrote:

> Hi all,
>
> Quick question, couldnt really figure it out from the manual - does
> Zend_Http_Client support pipelining (sending get multiple requests to
> the same host in one packet) ?
>
> I note the use of the Keep-Alive header, but am unsure of how to add
> multiple paths to the same request instance, and then how the response
> will be formated. Any tips appreciated.
>
> Cheers,
>
> Steven


signature.asc (196 bytes) Download Attachment