Hmmm... I don't see that with my GZip content as described with these functions:
http://www.west-wind.com/weblog/posts/2011/May/02/ASPNET-GZip-Encoding-Caveats
I think the issue you're having might be one of timing or caching. You need to make sure you only GZip after caching has occurred and if you do use Output caching you have to cache both GZipped and plain versions separately. Note that IIS will also cache itself with Kernal caching and that might also affect your request.
IOW, don't apply GZip in the BeginRequest module handler, but maybe in PreRequestHandlerExecute().
+++ Rick ---
Hello
I'm trying to compress the output of a WCF restful service, using GZipStream:
I put this in my global.asax:
The problem is that the field "Content-Length" of the response header still gets the value of the uncompressed stream.
For example, when I use fiddler to see what happens:
response header:
HTTP/1.1 200 OK
Date: Thu, 16 Feb 2012 14:25:32 GMT
Cache-Control: private
Content-Length: 472810
Content-Type: application/json
Content-Encoding: gzip
Vary: Content-Encoding
But I also get a fiddler pop up with the error:
Fiddler has detected a protocol violation in session #569.
Content-Length mismatch: Response Header indicated 472 810 bytes, but server sent 152 488 bytes.
Do you know what I've done wrong ?
Thanks
from Maui, Hawaii