我已经为动态内容启用了带有URL压缩的IIS 7.5。我想添加一个响应过滤器来删除修改呈现的html,并且由于某种原因,我在过滤时一直获取垃圾数据。
响应筛选器的写入方法的代码如下:
Encoding encoding = HttpContext.Current.Response.ContentEncoding;
string html = encoding.GetString(buffer);
html = regFindFollow.Replace(html, new MatchEvaluator(AddFollowNoFollowAttribute));
byte[] outdata = encoding.GetBytes(html);
当我从web配置中删除URL压缩时,这就开始工作了。我是不是丢了什么东西?是否可以指定响应筛选器的顺序?
我使用的配置是
<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" />