Windows服务“自托管” WCF:compression? [英] Windows Service "self hosted" WCF : compression?
问题描述
在IIS中使用压缩与WCF我可以找到文档,但它的方向使用IIS功能。
我可以找到人们谈论他们如何写自己的压缩处理程序,但它看起来很自定义。
有压缩WCF的最佳做法吗?我们正在使用http绑定。
编辑:设置为wiki。
你可以为WCF实现你自己的压缩扩展,有几个人已经做到了,您应该可以使用您最喜欢的搜索引擎找到它。
但是你可以为你的绑定做最好的事情 - 只要你的客户都在你的控制之下,您可以轻松地配置它们 - 将使用二进制消息编码与消息的文本表示。
您可以轻松地将二进制消息编码与http传输组合 - 您需要一个自定义绑定,但这真的不是一个大问题。很多人也这样做,所以你可以从已经完成的工作中受益:
- 二进制Http绑定作者:Nicolas Allen(WCF小组成员)在Microsoft)
- Silverlight 3 WCF二进制消息编码
- WCF二进制绑定在Silverlight 3 由John Papa(Silverlight envangelist)
- WCF:在Http上启用二进制编码
Using compression with WCF in IIS I can find documentation for, but its oriented towards using IIS features.
I can find people talking about how they've written their own compression handlers, but it all looks pretty custom.
Is there a best practice around compressing WCF? We're using http bindings.
Edit: setting this as a wiki.
There's nothing out of the box to help you with this.
You can indeed implement your own compression extensions for WCF - several folks have done it, and you should be able to find it using your favorite search engine.
But the best thing you could do for your bindings - as long as your clients all are under your control and you can easily configure them - would be to use binary message encoding vs. textual representations of messages.
You can easily combine binary message encoding with http transport - you need a custom binding, but that's really not a big deal at all. Lots of folks have done that, too - so you can benefit from work that's already been done:
- Binary Http Binding by Nicolas Allen (member of the WCF team at Microsoft)
- Silverlight 3 WCF Binary Message Encoding
- WCF Binary Bindings in Silverlight 3 by John Papa (Silverlight envangelist)
- WCF: Enable Binary Encoding Over Http
这篇关于Windows服务“自托管” WCF:compression?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!