http_proto
http_proto copied to clipboard
serializer should provide an interface for conditionally setting Content-Encoding header
For efficiency reasons, servers tend not to compress small response bodies. To address this, we define a threshold and skip compressing bodies smaller than that. However, for some source objects it is not possible to determine the body length beforehand (such as when serializing a Boost.JSON value). Since only the serializer knows the length of the produced data before compression, it should either handle this operation itself or provide the necessary information and interface for users to do so.