napoler / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

(UserSubmittedExtension) Gzip enable _sendRawPost #64

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hey,

i've done a gzip enable Version _sendRawPost. This is a pretty good thing if 
your solr index is placed in another datacenter. Our responses are about 1-2MB 
uncompressed, compressed they are about 100-200KB.
On the other hand the gzip Version depends on php 5.1 and mod_curl.

Hope you enjoy it,
Rafael.

Original issue reported on code.google.com by schlende...@gmx.net on 8 Mar 2011 at 5:43

Attachments:

GoogleCodeExporter commented 9 years ago
In the svn trunk, the details of HTTP transport have been abstracted so that 
users can choose to do things like this (choose curl over internal http 
implementation, etc). Have you tried trunk with a curl based HTTP transport set?

I'm not sure from the curl documentation whether it necessary for you to set 
the encoding option - i think it defaults to sending all supported encodings:

"The contents of the "Accept-Encoding: " header. This enables decoding of the 
response. Supported encodings are "identity", "deflate", and "gzip". If an 
empty string, "", is set, a header containing all supported encoding types is 
sent."

I'll try to take a look into this and confirm / deny whether the proper headers 
for gzip / deflate are sent by default - if not I'll add the option to the 
trunk implementations.

Original comment by donovan....@gmail.com on 8 Mar 2011 at 6:07

GoogleCodeExporter commented 9 years ago
Hey Donovan,

I studied the change in the current trunk, the http transport abstraction is a 
pretty cool thing.
I guess it is the right way to implement stuff like this for a general purpose 
(composite > inheritance).

I tried to remove the curl encoding option, but then the response is 1-2MB 
again. With the
"gzip, deflate" or the empty string "" it is just a tenth of it. In my opinion 
curl sends no encoding
header as default and that is like "identity".

cheers,
Rafael.

Original comment by schlende...@gmx.net on 9 Mar 2011 at 9:55

GoogleCodeExporter commented 9 years ago
Hi to use this ? What options/settings did you tweak in jetty/solr ?

Original comment by Jacque...@gmail.com on 19 May 2011 at 2:03

GoogleCodeExporter commented 9 years ago
Hi,

there is nothing special to do. "Deflate" should be enabled by default in 
Tomcat.

Cheers,
Rafael.

Original comment by schlende...@gmx.net on 19 May 2011 at 7:04