Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>We've got GZip compression working for WCF, I'll try to backtrack what we did to get it working. There are a few gotcha's which might bite you trying to get this to work (personally I'm moving trying to move away from WCF wherever possible).</p> <p>Firstly you need to have IIS Dynamic Compression installed. Secondly you must use browser http in the Silverlight app (which is the default in browser, but not when running OOB) since the build-in http stack doesn't support GZip compression. You can force this in the Application_Startup() function (change http to https if required).</p> <pre><code>WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.BrowserHttp); </code></pre> <p>The gotcha here is that you will only ever get generic errors in your client when a webservice call fails because the browser stack doesn't pass the content of an http 500 response on to Silverlight. Is this is an issue for you it can be worked around with a custom MessageInspector which changes the response code to 200 always.</p> <p>In your web.config you need to enable dynamic compression</p> <pre><code>&lt;system.webServer&gt; &lt;urlCompression doStaticCompression="true" doDynamicCompression="true" /&gt; </code></pre> <p>On top of that you need to have the mime type registered in IIS, we added this to the applicationHost.config for WCF with binary message encoding. </p> <pre><code>&lt;add mimeType="application/soap+msbin1" enabled="true" /&gt; </code></pre> <p>If your not using binary message encoding you probably need application/soap+xml instead here. If I recall correctly these are all the steps needed.</p> <p>The last gotcha though, it doesn't help when your client is sending large messages since there is no way (afaik) to make silverlight actually send gzip compressed requests to the server, so your only gain will be on the data send by the server.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload