开发者

Changing response type in aspx page breaks in IIS7

I have a custom implementation of Application_PreRequestHa开发者_开发百科ndlerExecute which is applying a deflate/gzip filter to the response. However, on IIS7, this is failing on my "script generator" pages. These aspx pages take in Query String values and return a custom bit of script, changing the response type to text/javascript. I think it is failing because of the way iis7 uses mime types, but I'm unsure how to fix it short of turning all compressio off.

Anyone faced this problem?


I understand you’re trying to implement your own gzip filter, but why don’t you consider 3rd-party software? For example there is mod_gzip module in Helicon Ape http://www.helicontech.com/ape/doc/mod_gzip.htm. It’s very powerful solution and you may enable text/* compression just in one line as follows:

SetEnvIf mime text/.* gzip=9

If you need to exclude javascript, you may try this:

SetEnvIf mime text/(?!javascript).* gzip=9

Helicon Ape is totally free for 3 websites. You may be interested in this.

But if you don’t prefer 3rd-party software, please make sure that native IIS compression is switched off. You may do it through IIS manager, see the Compression icon.

WFetch is also handy in such situations (http://www.microsoft.com/downloads/details.aspx?FamilyID=b134a806-d50e-4664-8348-da5c17129210). The latest version understands GZIP.

If you provide a few examples and WFetch output—the situation will look clearly. Thank you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜