Currently, the driver does support request compression, but it does not accept compressed responses.
We may want to enable compressed responses for DynamoDB operations that are expected to yield big payloads.
This one is tricky to implement using Interceptors, as Rust's safety mechanisms prevent us from modifying responses where it would make sense.
Below I list a few ways I think could work:
Custom Deserializer
We could use a custom SharedResponseDeserializer (possibly a wrapper around the one DynamoDB attaches to each operation call inside the ConfigBag).
To my knowledge all DynamoDB deserializers (example) expect a nonstreaming response.
So we could do the decompressing inside DeserializeResponse::deserialize_nonstreaming, just before sending to the inner deserializer.
Custom HttpClient
We could also use a wrapper around HttpClient and HttpConnector, and decompress the request just before it is send to the interceptors, inside HttpConnector::call.
Currently, the driver does support request compression, but it does not accept compressed responses.
We may want to enable compressed responses for DynamoDB operations that are expected to yield big payloads.
This one is tricky to implement using
Interceptors, as Rust's safety mechanisms prevent us from modifying responses where it would make sense.Below I list a few ways I think could work:
Custom Deserializer
We could use a custom
SharedResponseDeserializer(possibly a wrapper around the one DynamoDB attaches to each operation call inside theConfigBag).To my knowledge all DynamoDB deserializers (example) expect a nonstreaming response.
So we could do the decompressing inside
DeserializeResponse::deserialize_nonstreaming, just before sending to the inner deserializer.Custom HttpClient
We could also use a wrapper around
HttpClientandHttpConnector, and decompress the request just before it is send to the interceptors, insideHttpConnector::call.