How to get gzip compression working in WCF 4.5

后端 未结 1 405
旧巷少年郎
旧巷少年郎 2020-12-05 14:32

WCF 4.5 supports GZIP without third party libraries or handwritten extensions. I got it working via TCP Binding, but cannot find a way to get it working via HTTP Binding. m

相关标签:
1条回答
  • 2020-12-05 14:56

    As per request I copied my comment as answer:

    "Since this property is only exposed on the binaryMessageEncodingBindingElement, you will need to create a custom binding like the following to use this feature:

    <customBinding>
      <binding name="BinaryCompressionBinding"> 
        <binaryMessageEncoding compressionFormat="GZip"/> 
        <httpTransport /> 
      </binding>
    </customBinding> 
    

    and receive compressed messages and therefore the compressionFormat property must be configured on the binaryMessageEncoding element on both client and service. "Both the client and the service need to agree to send

    0 讨论(0)
提交回复
热议问题