What Theory Says – If compression is enabled during channel creation, the client will send header compression header (grpc-accept-encoding: identity,gzip) and server can will decide on this. Here only the server response will be compressed, not the client and that is we are trying to attain.
But the server log says "Client supports response compression: none"
A detailed search on it suggested explicitly requesting compression per message, but both of the below options were not usable with the project setup.
var callOptions = new CallOptions()
.WithWriteOptions(new WriteOptions(WriteFlags.UseCompression)); Note: this is to explicitly set compression request per message.
var response = await client.MyRpcMethodAsync(new MyRequest(), callOptions);
But we cannot use WriteFlags.UseCompression in ASP.NET core and Grpc.Net.Client
OR
var callOptions = Grpc.Net.Client.GrpcCallOptionsExtensions.WithCompression(new CallOptions(), "gzip");
using var call = client.RequestData(request, callOptions);
Both of them were not available.
What we are looking for.
A solution to tackle the issue or sample compression implementation using gRPC and ASP.NET core