def compress_value?(value, req_options)
        return false unless value.bytesize >= compression_min_size
        return compress_by_default? unless req_options && !req_options[:compress].nil?

        req_options[:compress]
      end
Checks whether we should apply compression when serializing a value
based on the specified options.  Returns false unless the value
is greater than the minimum compression size.  Otherwise returns
based on a method-level option if specified, falling back to the
server default.