How can we compress JSON response of a search request? I have tried following setting, but it didn't seem to work. http.compression = true
Request Header has following information.
Accept:"application/json, text/plain,/"
Accept-Language:"en-US,en;q=0.5"
Accept-Encoding:"gzip, deflate"
Content-Type:"application/json;charset=utf-8"
As text data, JSON data compresses nicely. That's why gzip is our first option to reduce the JSON data size. Moreover, it can be automatically applied in HTTP, the common protocol for sending and receiving JSON.
Interoperable. Search UI can be used with any search service, and includes prebuilt connectors for Elasticsearch.
You can check if http compression is enabled by performing a simple curl GET request like this:
curl -H 'Accept-Encoding: gzip,deflate' -D - http://localhost:9200
If compression is enabled you will see the header Content-Encoding: gzip
and the response will look compressed (random weird characters).
If compression is NOT enabled, you'll see the normal ES info response, something like this:
{
"status" : 200,
"name" : "Steven Lang",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.7.0",
"build_hash" : "929b9739cae115e73c346cb5f9a6f24ba735a743",
"build_timestamp" : "2015-07-16T14:31:07Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With