2010-11-30 56 views
1

我有IIS 7.5的動態內容啓用URL壓縮。我想添加一個響應過濾器來刪除修改呈現的HTML,並出於某種原因,我一直在過濾垃圾數據。URLCompression +響應過濾器衝突

爲響應濾波器的寫入方法的代碼如下:

Encoding encoding = HttpContext.Current.Response.ContentEncoding; 
    string html = encoding.GetString(buffer); 

    html = regFindFollow.Replace(html, new MatchEvaluator(AddFollowNoFollowAttribute)); 

    byte[] outdata = encoding.GetBytes(html); 

這將啓動,當我從網絡配置中刪除URL壓縮工作。我在這裏錯過了什麼嗎?是否可以指定響應過濾器的訂單?我使用

配置是

<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" /> 

回答

1

<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="false" /> 

修正此更改配置。我想在執行模塊期間收到壓縮的HTML並無法解析它。