From d6b3525fce309648fa84e2e7b60f49873c3c366d Mon Sep 17 00:00:00 2001 From: Sardorbek Pulatov Date: Tue, 5 Nov 2019 16:42:32 +0100 Subject: [PATCH] (doc): add compression documentation part of #402 --- Documentation/compression.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/compression.md diff --git a/Documentation/compression.md b/Documentation/compression.md new file mode 100644 index 00000000..67cb1276 --- /dev/null +++ b/Documentation/compression.md @@ -0,0 +1,31 @@ +# Compression + +## Client side +The preferred method for configuring message compression on a client is to pass `options` when the client object is instantiated. + +The two options need to be passed: + +**grpc.default_compression_algorithm** (integer) + +The option keeps the value of a compression algorithm. + +Possible values for this option are: +- `0` - No compression +- `1` - Compress with DEFLATE algorithm +- `2` - Compress with GZIP algorithm +- `3` - Stream compression with GZIP algorithm + +**grpc.default_compression_level** (integer) + +The option keeps the value for the level of compression. + +Possible values for this option are: +- `0` - None +- `1` - Low level +- `2` - Medium level +- `3` - High level + +### Code example +```javascript +client = new ExampleClient("example.com", credentials.createInsecure(), {'grpc.default_compression_algorithm': 2, 'grpc.default_compression_level': 2}); +```