Windows服务“自托管” WCF:compression? [英] Windows Service "self hosted" WCF : compression?

查看:197
本文介绍了Windows服务“自托管” WCF:compression?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IIS中使用压缩与WCF我可以找到文档,但它的方向使用IIS功能。



我可以找到人们谈论他们如何写自己的压缩处理程序,但它看起来很自定义。



有压缩WCF的最佳做法吗?我们正在使用http绑定。



编辑:设置为wiki。

解决方案<



你可以为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:

这篇关于Windows服务“自托管” WCF:compression?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆