我怎样才能获得gzip的COM pression在IIS7的工作? [英] How can I get gzip compression in IIS7 working?

查看:126
本文介绍了我怎样才能获得gzip的COM pression在IIS7的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了静态和动态融为一体pression的IIS7,以及在我的应用程序设置两个的web.config 虚拟文件夹的水平。据我了解,我并不需要启用COM pression在服务器或站点级别的了,我可以在每个文件夹的基础上使用我的web.config文件进行管理。

I have installed Static and dynamic compression for IIS7, as well as setting the two web.config values at my application Virtual Folder level. As I understand it, I don't need to enable compression at the server, or site level anymore, and I can manage it on a per folder basis using my web.config file.

我在的.config 文件中的两个设置,我设置为我的应用程序自定义的gzip:

I have two settings in my .config file that I have set to customize gzip for my app:

<httpCompression dynamicCompressionDisableCpuUsage="90"
    dynamicCompressionEnableCpuUsage="0">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
  <dynamicTypes>
    <remove mimeType="*/*"/>
    <add mimeType="*/*" enabled="true" />
  </dynamicTypes>
</httpCompression>
<urlCompression doDynamicCompression="true"
    dynamicCompressionBeforeCache="true" />

然而,当我运行的应用程序,我可以清楚地看到,GZIP不使用,因为我的页面大小是一样的。我也使用 YSlow的了解火狐,这也印证了我的网页没有被gziped。

However, when I run the application, I can clearly see that gzip is not used, because my page sizes are the same. I am also using YSlow for FireFox, which also confirms that my pages are not being gziped.

我在想什么吗?在IIS6它是指定文件的类型,并设置0-10之间的玉米pression水平的一个简单的事情。我不认为有必要记录到指定的文件类型或COM pression水平,因为默认设置似乎覆盖的文件类型,而我没有看到水平的任何地方。

What am I missing here? In IIS6 it was a simple matter of specifying the file types, and setting the compression level between 0-10. I don't see the need documented to specify the file types or compression level, since the defaults seem to cover the file types, and I'm not seeing the level anywhere.

推荐答案

有上forums.iis.net这个线程的IIS 7测试版中。原来这家伙没有安装的模块,但它听起来像是你已经排除了这种可能性从开头一句。

There was a thread on forums.iis.net about this during the iis 7 beta. Turned out the guy didn't have the modules installed, but it sounds like you've ruled that out from your opening sentence.

微软的关键建议是启用失败请求跟踪,找出发生了什么事情错了。这可能是一个IIS7的最下-AP preciated功能,但肯定是最强大的一个。

Microsofts key advice for him was to enable failed request tracing to find out what was going wrong. This is possibly one of the most under-appreciated features of IIS7, but certainly one of the most powerful.

  • 打开IIS管理器。
  • 进入你的网站,并在操作窗格(很远的右边),单击失败请求跟踪......下的配置部分。
  • 单击启用。
  • 然后,在功能视图中,单击失败请求跟踪规则。点击添加,接下来,进入200状态code,下一步,单击完成。

如果您没有看到失败请求跟踪在操作窗格中,您需要将功能添加到服务器 - 或者使用添加角色服务向导(健康状况和诊断\跟踪)或通过Web平台安装(产品\服务器\ IIS:跟踪),然后关闭并重新打开IIS管理器

If you don't see "Failed Request Tracing" in the actions pane, you'll need to add the feature to the server - either using the "Add Role Services" wizard (Health and Diagnostics\Tracing) or through the Web Platform Installer (Products\Server\IIS: Tracing), and then close and re-open IIS Manager.

接下来,重新运行测试。这会产生一些日志信息,为我们审视。

Next, rerun your test. This will generate some log info for us to examine.

查找在C:\的Inetpub \日志\ FailedReqLogFiles \ w3svcx。你会看到一堆名为fr000xx.xml文件。打开他们的浏览器中的任何一个。 (顺便说一下,如果你在任何地方复制这些文件,确保freb.xsl是存在的同时,不要删除freb.xsl - 如果你做什么,只是删除整个目录或从其他位置复制它,因为IIS只创建这一次,每个文件夹。)

Look in c:\inetpub\logs\FailedReqLogFiles\w3svcx. You will see a bunch of files named fr000xx.xml. Open up any one of them in your browser. (By the way, if you copy these files anywhere, make sure freb.xsl is there. Also, don't delete freb.xsl - if you do, just delete the whole directory or copy it from another location, as IIS only creates it once per folder.)

点击请求详细信息选项卡,然后选择完整的请求跟踪。搜索页面的COM preSS' - 你会发现它在几个领域;一旦静态内容,并且一次用于动态内容。

Click the 'request details' tab and select 'complete request trace'. Search the page for 'compress' - you should find it in several areas; once for static content, and once for dynamic content.

如果你没有找到任何他们做,IIS配置不正确。如果你找到他们,你会看到他们跟着一个COM pression_success和一个COM pression_do。成功是自我解释;在做表明它的所作所为 - 在我的情况,这表明OriginalSize 1462784的COM pressedSize 179482

If you don't find either of them, IIS isn't configured correctly. If you do find them, you should see them followed by a compression_success and a compression_do. Success is self explanatory; the 'do' indicates what it did - in my case, it showed "OriginalSize 1462784 CompressedSize 179482"

既然你不工作,希望你会看到不同的东西,可以帮助你解决这个问题。

Since yours isn't working, hopefully you will see something different that helps you solve the problem.

请确保您通过禁用失败请求的操作跟踪窗格为您的网站关闭此功能时,即可大功告成。

Make sure you turn this off when you're done by disabling failed request tracing in the actions pane for your website.

这篇关于我怎样才能获得gzip的COM pression在IIS7的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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