Windows Phone 7 http 堆栈上的 http 压缩
我在最终的 WP7 平台发布之前提出了这个问题,但从未收到团队的明确答案 - 看来 WP7 中的 http 堆栈不支持压缩。我发现这一点的方法是在运行模拟器时使用 fiddler - 当我请求一个 ODATA 提要时,该提要在被 Silverlight3/4 接收时被压缩 - 当被 WP7 应用程序接收时不会被压缩。
有人确认 WP7 上的 Silverlight HTTP 堆栈支持/不支持 http 压缩吗?
谢谢 迈克尔
I asked this question before the final WP7 platform was released and never received a definitive answer from the team - it appears that the http stack in WP7 DOES NOT support compression. The way I found this out was by using fiddler while running the emulator - when I request an ODATA feed that is compressed when received by Silverlight3/4 - is not compressed when received by an WP7 app.
Does anyone have confirmation that the Silverlight HTTP stack on WP7 DOES/DOES NOT support http compression?
thanks
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回应我的 twitter 上的问题“你知道是否可以支持 gzip 编码用于 REST 服务?”,Joe Marini(Microsoft Windows Phone Web 平台首席项目经理)回复“是的,支持gzip。”
较长的答案是支持压缩的 HTTP 内容,但您无法更改 HTTP 请求中的 Accept-Encoding 标头来请求压缩响应。但是,如果响应被压缩,那么您可以接收、解压缩和处理该响应。
我目前正在开发一个正好存在此问题的 WP7 应用程序,我们通过使用不同的标头来请求压缩响应(X-Accept-Encoding)来解决该问题,但这需要服务器理解此自定义标头。
您可能会发现Hammock 库很有用;我认为它通过 X-Accept-Encoding 支持 GZIP 压缩。
In response to my question on twitter "Do you know if it's possible to support gzip encoding for REST services?", Joe Marini (Principal Program Manager at Microsoft for Web platform on Windows Phone) replied "Yes, gzip is supported."
The longer answer is that compressed HTTP content is supported, but you can't change the Accept-Encoding header in an HTTP request to request that the response is compressed. However, if the response is compressed, then you can receive, decompress, and handle that response.
I'm currently working on a WP7 application that has exactly this problem, which we have worked round by using a different header to request a compressed response (X-Accept-Encoding), but this requires that the server understands this custom header.
You might the find the Hammock library useful; I think it supports GZIP compression via the X-Accept-Encoding.