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.