HTTP Compression in .NET Sucks

Every year or so I find myself needing/wanting HTTP compression in a .NET app. This time around, I have an ASP.NET WebMethod which is passed a big glob of text by clients, and returns another big glob of text.
I therefore want to compress the SOAP request and response. As it turns out, this is a Hard Problem.
First, ASP.NET doesn’t provide any HTTP compression built-in. IIS 6 will compress HTTP responses, or you can build an HTTP module in ASP.NET. In ASP.NET 2.0 this is made easier by official, MS-provided compression classes.
Second, the .NET 1.1 WebClient doesn’t support HTTP compression at all. Period. The .NET 2.0 version supports decompressing compressed responses, but doesn’t compress its own requests.
Using WSE 2.0, which provides a more robust pre/postprocessing pipeline, SOAP envelope compression has been implemented in various unsupported experimental libraries and even a terse Code Project article, but nothing comprehensive at the HTTP level. Lame.

Tags: , , , ,

Leave a Reply