IIS7动态内容融为一体pression和Web服务 [英] IIS7 dynamic content compression and webservices

查看:276
本文介绍了IIS7动态内容融为一体pression和Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感动老ASMX web服务到一个新的服务器IIS7。
这基本上是Web服务发送一个大的数据集(10MB +),以一个WinForm应用程序。
旧的溶液使用自定义肥皂分机发送该视频流给客户机之前哪个COM pressed内容实施。当然
客户端,实现相同的自定义SOAP扩展,以DECOM $ P $数据集中pssed流。 一切曾pretty的好多年。
我的客户不希望改变code升级到WCF。他们只是希望把旧的应用程序在新服务器上,并使用新的动态内容融为一体pression功能。
我们正在测试的东西在测试服务器上(赢SERV 2008),似乎它的工作pretty的很好,即使它看起来很慢:我们不能看到uncom $ P $之间的性能(速度)有什么区别pssed和COM pressed流。
这里的问题。我应该在哪里放置设置?大多数人说我不能把它放在我的web.config;有人说这可以放在那里。我有点糊涂了。
是否有任何技巧或东西我应该知道吗? 那么MIME类型?我应该设置一些参数,什么地方? ......考虑到我流是XML(数据集)??

I am moving and old asmx webservice to a new server with IIS7.
This webservice basically sends a big dataset (10mb+) to a winform application.
The old solution was implemented using a custom soap extension which compressed the content before sending the stream to the client.
The client, of course, implemented the same custom soap extension, to decompressed the stream in a dataset. Everything has worked pretty well for years.
My customer doesn't want to change the code upgrading to WCF. They just want to put the old App on the new server and use the new dynamic content compression features.
We're testing things on a test server (win serv 2008) and it seems that it's working pretty well, even if it seems slow: we can't see any difference in performance (speed) between the uncompressed and compressed stream.
Here's the question. Where should I put the settings? Most people say I can't put it in my web.config; others say it can be put there. I am a bit confused.
Are there any tricks or things I should know? What about mimeTypes? Should I set some parameters, somewhere? ... considering my stream is XML (dataset) ??

谢谢大家谁愿意帮助

阿尔贝托

推荐答案

假设你可以轻松地禁用您的COM pression code,然后用IIS7 COM pression特点是pretty的简单。

Assuming you can easily disable your compression code, then using the IIS7 compression features is pretty simple.

您可以启用和禁用上的web.config文件夹,文件夹级别的IIS7 COM pression。

You can enable and disable compression on a folder-folder level with web.config in IIS7.

但是,其控制配置哪些mime类型是玉米pressed,哪些是不被存储在网络服务器级别

However, the configuration that controls which mimetypes are compressed and which are not are stored at the webserver level.

要启用一个给定的网站/ VDIR /文件夹中的动态融为一体pression,假设服务器已安装了动态融为一体pression功能,只要打开你的网站/文件夹在IIS管理器,然后打在'的COM pression图标。在这里,您可以启用静态和动态融为一体pression。

To enable the dynamic compression on a given site/vdir/folder, assuming that the server has the Dynamic compression feature installed, just open up your site/folder in IIS manager, and then hit the 'Compression' icon. Here you can enable both static and dynamic compression.

在这一点上,检查,看它是否曾(即流量被打COM pressed)。如果是这样,那么默认的动态融为一体pression配置是工作,你可以去抓取,早午餐:)

At this point, check to see if it has worked (i.e. that the traffic does get compressed). If so, then the default dynamic compression config is working and you can go and grab and early lunch :)

如果没有,那么你需要:

If not, then you need to:

  • 单击在IIS管理器的服务器节点(在根)上。然后打开配置编辑器(在最后一行,通常在左边)。
  • 在出现的,展开system.webserver节点,然后单击httpCom pression叶节点上的窗体上的下拉列表。
  • 现在,你会看到所有的COM pression服务器范围内的配置选项 - 你要打开dynamicTypes设置
  • 在那里,你可以为你需要COM pressing的MIME类型添加额外的规则。

一件事,这是一个有点讨厌这个就是MIME类型都完全匹配,有时默认的规则将不会匹配你想要的一切。

One thing that's a little bit annoying with this is that the mimetypes are matched exactly, and sometimes the default rules won't match everything you want.

我举个例子,增加了4个额外的规则,我们的服务器:

I, for example, have added 4 extra rules to our servers:

  • 在应用程序/ JSON
  • 在应用程序/ XML

然后:

  • 在应用程序/ JSON;字符集= UTF8
  • 在应用程序/ xml的;字符集= UTF8

由于,出于某种原因,我发现我的JSON的MIMETYPE /从.net XML响应有这种额外的字符集=末位。如果是这样,它不是在规则列表中,然后IIS7 COM pression不会踢,他带我年龄(和大量的使用小提琴手!)的推测此位了!

Because, for some reason, I've found that the mimetype of my json/xml responses from .Net have had this extra 'charset=' bit at the end. If it does, and it's not in the rules list, then IIS7 compression will not kick in. Took me ages (and a lot of use of Fiddler!) to figure this bit out!

这篇关于IIS7动态内容融为一体pression和Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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