IIS 6 has builtin gzip compression ability which can compress output of dynamic webpages (.aspx) and webservices (.asmx). The compression is really good and can easily reduce 60% download time.You should always turn this feature on in your production server. The CPU usage is not that high compared to the reduction of download time for users. Your users will love the significant download time reduction when you turn it on.

Now, on internet you will find a lot of solutions. I tried all of them which appears in first 30 Google search results. But failed to make any of them work properly. Finally I was able to make it work, but I realized you have to do it in a very specific way and in specific order. Here it goes:

 

IIS 6 有内建 gzip 压缩能力,可以压缩动态网页 (.aspx) 和 webservices (.asmx) 的输出。 压缩真不错,可以轻松地将减少 60%下载时间。你应该在您的生产服务器中始终开启此功能。 CPU 使用率不会很高且减少用户的下载时间。 当您打开它时,你的用户会喜欢缩短宝贵的下载时间。

现在,在网上,你会发现大量的解决方案。 我试过所有Google 搜索结果中出现的前30项。 但未能使任何人的正常工作。 最后我才得以使其工作,但我建议你要做一个非常具体的方式和按特定顺序。 在这里,它是:

  • Go to IIS Manager from Administrative Tools
  • 从管理工具转到 IIS 管理器中
  • Right click on your computer name (not on websites or Default Web Site)
  •  右键单击您的计算机名称 (不在网站或默认 Web 站点)
  • Choose All Tasks-> Restart IIS
  • 选择所有任务->重启IIS
  • From the drop down, choose “Stop IIS” and click OK.
  • 下拉选择"停止 IIS",并单击确定。
  • IIS is not stopped. Make sure it’s not still running
  • 未停止 IIS。 请确保它不在运行
  • Now go to C:\WINDOWS\SYSTEM32\INETSRV
  • 现在去到  C:\WINDOWS\SYSTEM32\INETSRV
  • Make a copy of the file Metabase.xml. This is a dangerous file, don’t play around with it. Make sure you have a backup before you do what I am going to tell you now.
  • 制作 Metabase.xml 文件的一个副本。 这是一个危险的文件,不要玩弄它。 请确保您有一个备份之前你做我现在要告诉你。
  • Open the metabase.xml in Notepad. Don’t use any other editor besides Notepad, Notepad2 or Visual Studio.
  • 在记事本中打开该 metabase.xml。 不要使用记事本、 Notepad2 或 Visual Studio 以外的任何其他编辑器
  • Find using “IIsCompressionScheme”查找使用“IIs压缩方案”
  • You will find a match which looks like this: “<IIsCompressionScheme Location=”/LM/W3SVC/Filters/Compression/deflate” There are two nodes named IIsCompressionScheme and one node with plural IIsCompressionSchemes.
  • 你会发现匹配项,这种看上去像这样“<IIsCompressionScheme Location=”/LM/W3SVC/Filters/Compression/deflate” 有两个名为 IIsCompressionScheme 和复数 IIsCompressionSchemes 具有一个节点的节点。
  • Delete these nodes. 删除这些节点
  • Once you have deleted the 3 nodes, paste the text from this link in in their position: http://tinypaste.com/630fc
  • 一旦删除了 3 节点,在此链接上的位置从本粘贴文本
Now start IIS and hit your site once. When it runs for the first time, it will send uncompressed output, but it will compress it behind the scene. So, next hit will give you the compressed output.
现在启动 IIS 和点击一次您的网站。 当它第一次运行时,它将发送未压缩的输出,但它将在后台压缩。 所以下, 下一次点击将给你压缩的输出。

Go to www.pipeboost.com and enter the URL to ensure you are getting compressed content. Before you do so, make sure you have visited your site for a while in your local browser so that the pages got the chance to get themselves compressed.

请到 www.pipeboost.com 并输入该 URL,以确保您得到压缩的内容。 在执行此操作之前请确认您在本地浏览器中访问您的站点一会儿,以便页面有机会获得自己压缩。

 

以上内容来自:http://omaralzabir.com/iis_6_compression___quickest_and_effective_way_to_do_it_for_asp_net_compression/