title: Getting IIS gzip compression to work with Silverlight WCF service on .NET 4.0
body: <p>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.</p>
  
  <p>Here's what I tried so far</p>
  
  <ul>
  <li>Enabled compression (dynamic and static) for all mime types (<em>/</em>). Verified that it works (a hit on an aspx page returns gzipped data as per fiddler)</li>
  <li>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.</li>
  <li>Also got a few examples on using GZipEncoder (from Microsoft WCF Samples) </li>
  </ul>
  
  <p>And here's what I'd like to find out</p>
  
  <ul>
  <li>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?</li>
  <li>If not, what is the easiest way to get it to work (say, add a dll, change my Web.Config and done!)</li>
  </ul>
  
  <p>Thanks folks!</p>
  
  <p>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.</p>