hm..., i think you misunderstood my goal/problem. here are my handler:
public void ProcessRequest(HttpContext context)
{
if (Preferences.EnableHtmlMinification && **IfResponseContentIsHtml**)
{
//Do minify here
}
if (Preferences.EnableHtmlCompression && **IfResponseContentIsHtml**)
{
acceptEncoding = acceptEncoding.ToLower(CultureInfo.InvariantCulture);
if (acceptEncoding.Contains("gzip"))
{
response.Filter = new HtmlCompressStream(response.Filter, CompressionMode.Compress, HtmlCompressStream.CompressionType.GZip);
response.AddHeader("Content-encoding", "gzip");
}
else if (acceptEncoding.Contains("deflate"))
{
response.Filter = new HtmlCompressStream(response.Filter, CompressionMode.Compress, HtmlCompressStream.CompressionType.Deflate);
response.AddHeader("Content-encoding", "deflate");
}
}
else
{
response.Filter = new HtmlCompressStream(response.Filter, CompressionMode.Compress, HtmlCompressStream.CompressionType.None);
}
}