Hi all,
I have a very simple requirement that is to compress the responses from one of my server methods, but none of my attempts seem to work.
At first this seemed to be the solution, but no success.
Basically no matter what I try, the server always prints in the logs: "Algorithm 'gzip' enabled but decided not to compress. Input size: 900008".
I also get the error that the previously linked post was talking about:
"prepare_application_metadata: {"created":"@1553495392.669243000","description":"Unallowed duplicate metadata","file":"/tmpfs/src/github/grpc/workspace_csharp_ext_macos_x64/src/core/lib/transport/metadata_batch.cc","file_line":113,"key":"grpc-internal-encoding-request","value":"gzip"}"
I have a simple server + service that only has one request.
I've tried various combinations of the following:
- setting server side ChannelOption "default_compression_level" to Low.
- adding the following to my service method:
var headers = new Metadata{new Metadata.Entry("grpc-internal-encoding-request", "gzip")};
await context.WriteResponseHeadersAsync(headers);
- the following as either a call option and/or channel options:
new Metadata.Entry("grpc-internal-encoding-request", "gzip")
The things is, server side always logs that it "decided not to compress".
My log settings are: GRPC_TRACE=compression;GRPC_VERBOSITY=DEBUG
My question is, what is the correct combination to get the server to reply with a compressed payload ?
Thanks
Sam