开发者

IIS 7.5 Compression isn't working

I am trying to get IIS 7.5 compression working. It sounds so simple by all the blogs, but it isn't working for me. I am using asp.net mvc if that matters. I am testing this locally, and I am using IIS 7.5, not cassini. I have read and tried every article I can find. I have made sure the static and dynamic compression modules are installed. I have tried several articles like this, that talk about setting it up using appcmd. I have tried several articles like this, that configure the settings in the web.config. I have checked the mime types as discussed in articles where js files were only working sometimes (I can't post the link because I am a new user and limited to 2 links). I have created action filters for mvc as discussed in many blogs (again, I can't post the links)

None of the methods are compressing anything. No css, no js, no pages... nothing. I can even step through the code, I see that the action filter is running, I even see it running the following two lines, and yet fiddler shows no compression.

response.AppendHeader("Content-encoding", "gzip");
response.Filter = new GZipStream(response.Filter, CompressionMode.Compress);

I must be having a h开发者_如何转开发uge brain fart and missing something really stupid, but I can't figure it out.

Does IIS compression just not run when running locally? Does the IIS compression not work with MVC because of the routing or something?

Any suggestions/tests/info?


Try adding the staticContent element to the web.config.

http://www.iis.net/ConfigReference/system.webServer/staticContent

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜