Note that there are some explanatory texts on larger screens.

plurals
  1. POI'm attempting to force gzip compression on a page using GZipStream but the browser says I'm using unsupported compression
    text
    copied!<p>I'm tring to implement what Steve Souders discusses <a href="http://www.stevesouders.com/blog/2010/07/12/velocity-forcing-gzip-compression/" rel="nofollow noreferrer">http://www.stevesouders.com/blog/2010/07/12/velocity-forcing-gzip-compression/</a> about forcing gzip compression</p> <p>I've got a module that's running this:</p> <pre><code>void context_PreSendRequestHeaders(object sender, EventArgs e) { var app = sender as HttpApplication; var request = app.Request; var response = app.Response; if (CompressionUtils.GzipSupported(request) || CompressionUtils.GzipNotSupportedExplicitly(request)) { return; } if (CompressionUtils.GzipSupportedExplicitly(request)) { response.Filter = new GZipStream(response.Filter, CompressionMode.Compress); response.AddHeader(HttpHeaderKey.ContentEncoding, "gzip"); return; } response.Write("&lt;iframe style=\"display:none;\" src=\"/CompressedPage.aspx\"&gt;&lt;/iframe&gt;"); } </code></pre> <p><code>CompressionUtils.GzipSupported</code> just checks for the 'accepts-encoding' header while <code>CompressionUtils.GzipSupportedExplicitly</code> and <code>CompressionUtils.GzipNotSupportedExplicitly</code> check for the cookie saying whether the browser really can read gzip</p> <p>But when I load a page in Firefox I get this error: </p> <blockquote> <p>Content Encoding Error</p> <p>The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.</p> </blockquote> <p>and in Fiddler it shows that the content-encoding header has been added but the content hasn't been compressed</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload