在IIS6 ASP.NET MVC COM pression选项 [英] ASP.NET MVC compression options in IIS6

查看:201
本文介绍了在IIS6 ASP.NET MVC COM pression选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我卡与IIS6的ASP.NET MVC的(如我不能升级到Windows Server 2008至今)。它似乎知道我的REST风格的网址是动态文件,而不是COM pressing他们。

For now I'm stuck with IIS6 for ASP.NET-MVC (as in I cant upgrade to Server 2008 yet). It doesnt seem to know that my RESTful URLS are dynamic files and isn't compressing them.

我以前所有的.aspx文件是COM pressed(如提琴手看到的),而不是'/产品/ 1001 键入的URL。

All my old .aspx files are compressed (as seen in Fiddler), but not the '/products/1001' type URLS.

有没有什么办法让IIS6对COM preSS我在IIS6 ActionResults无需使用类似的<一个href=\"http://weblogs.asp.net/rashid/archive/2008/03/28/asp-net-mvc-action-filter-caching-and-com$p$pssion.aspx\"相对=nofollow> ActionFilter为COM pression 。

Is there any way to get IIS6 to compress my ActionResults in IIS6 without using something like an ActionFilter for compression.

我假设IIS7足够聪明知道他们是正确的动态

I'm assuming IIS7 is clever enough to know they're dynamic right.

奖励积分,如果你能告诉我怎么IIS6甚至知道哪些文件是摆在首位的动态!

Bonus points if you can tell me how IIS6 even knows which files are dynamic in the first place!

推荐答案

由于HTTP COM pression为ASP.NET平时一直使用的HttpModules自1.0版本实现,的HttpModules仍属于使用ASP.NET请求管道通过MVC框架,你仍然可以使用HTTP模块中注入gzip或deflate响应滤波器。

As HTTP compression for ASP.NET usually has been implemented using HttpModules since version 1.0, and HttpModules still belong to the ASP.NET request pipeline used by the MVC framework, you can still use a HttpModule to inject a GZIP or deflate response filter.

在这里,你可以找到一个很不错的,开源的,准备出货的实现:
HttpCom preSS由本·洛厄里(下载时的Google code

Here you can find a very nice, open-source, ready to ship implementation: HttpCompress by Ben Lowery (download at Google Code)

您只需要添加对DLL的引用,并添加几行到你的web.config。它已经处理了非常奇特而罕见的情况下和异常。您可以添加排除到你的web.config,而不是基于文件扩展名(如在IIS6),但在MIME类型,这可能正是你需要的。

You just have to add a reference to the DLL, and add a few lines to your web.config. It already handles very exotic and rare cases and exceptions. You can add exclusions to your web.config, not based on file extensions (like in IIS6), but on mime type, which is probably exactly what you need.

我要补充一点,我在IIS6使用这个库实际运行一个ASP.NET MVC的网站,所以我可以证实,这个工程在实践中。

I should add that I have actually running a ASP.NET MVC website on IIS6 using this library, so I can confirm that this works in practice.

这篇关于在IIS6 ASP.NET MVC COM pression选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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