I have a Silverlight project getting data from an IIS 7.0 server via WCF web services. The data returned is usually large, so compression seemed like a good option. However, for the life of me, I can't get it to work.
Here's what I tried so far
- Enabled compression (dynamic and static) for all mime types (/). Verified that it works (a hit on an aspx page returns gzipped data as per fiddler)
- Did a whole lot of digging around on WCF and compression. I read something along the lines of WCF 4.5 having something to enable / disable gzip. I'm not sure if this means that IIS 7.0 dynamic compression cannot be used, or if its something unrelated.
- Also got a few examples on using GZipEncoder (from Microsoft WCF Samples)
And here's what I'd like to find out
- With Silverlight reading data from WCF hosted on an IIS 7.0 server with .NET 4.0, is it possible to turn on compression for the XML responses by simply messing around with the Web.Config / applicationHost.Config?
- If not, what is the easiest way to get it to work (say, add a dll, change my Web.Config and done!)
Thanks folks!
Edit: Thanks for all the answers folks. Just one quick note - if someone can confirm that it does not work for WCF 4.0 "or" works with WCF 4.0 only if you do this, that'd help.