Q:

GZIP output stream

I am trying to GZIP some XML that gets streamed over HTTP (not a web service)
if (ZipOutput)
{
    output = new GZipStream(Context.Response.OutputStream, CompressionMode.Compress);
    Context.Response.AppendHeader("Content-Encoding", "gzip");
}
else
{
    output = Context.Response.OutputStream;
}

EscapeXMLTextWriter xmlWriter = new EscapeXMLTextWriter(output, new UTF8Encoding())
{
    Formatting = Formatting.Indented
};

ZipOutput is true, but the response doesn't seem to be zipped. Any pointers, alternative techniques?
I know I could use SharpZipLib, but wanted to use the GZipStream class in the framework.

A:

It looks to me like your code should work - maybe step through it with a debugger to check that the code is really being called as you think it is.
There's a good article on this (including one alternative technique) at - http://www.west-wind.com/weblog/posts/2007/Feb/05/More-on-GZip-compression-with-ASPNET-Content

A:

I figured this issue out I think - it turned out the office firewall was stripping the Accept-Encoding header on outbound requests.

