I'm working on a thing that uses an HttpWebRequest to talk to a backend WCF Data Service and it'd be ideal if the traffic was using HTTP Compression (gzip, deflate, etc).
On the client side, it's easy to just add code like this
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
or more manually
var request = HttpWebRequest.Create("http://foofoo");
request.Headers["Accept"] = "application/json";
request.Headers["Accept-Encoding"] = "gzip, deflate";
However, you need to make sure this is installed and turned on in IIS7 in you server.
Launch your IIS Manager and go to the Compression module.
Read more: Scott Hanselman
0 comments:
Post a Comment