Optimise Dynamics CRM 2011 using WCF Compression

IIS automatically compresses many types of content including script, images and css files to help improve network performance by minimizing the amount of data required to be transferred between the client and server. WCF responses which have a mimetype of ‘application/soap+xml;charset=utf-8’ are not compressed by default by IIS.

Dynamics CRM 2011 Outlook client uses WCF to retrieve data from the server and minimizing the network traffic across these clients especially when there are a large number of Dynamics CRM Outlook client users can have a positive impact on network load freeing up resource for other processes.

With WCF compression enabled you may see up to 30% reduction in response size and you can discover this by analyzing network traffic before and after it is enabled. The largest benefit that can be obtained from compression is by enabling SSL for your Dynamics CRM deployment, even for on-premise. Using SSL you may be able to gain an 80% reduction in the response size for your Dynamics CRM Outlook clients. The side effect to all of this is the impact on server resource in particular CPU when it performs the compression and with SSL, the encryption. Therefore it may not provide benefits in every scenario though weighing up the different aspects of your environment including the amount of users, and performance testing these features may show a positive increase in network performance.

Enable compression using a command line

  • Open the Command Prompt on the CRM Server.
  • Run the following command:

%SYSTEMROOT%\system32\inetsrv\appcmd.exe set config -section:system.webServer/httpCompression /+”dynamicTypes.[mimeType=’application/soap+xml; charset=utf-8′,enabled=’true’]” /commit:apphost

  •  Reset IIS for the setting to take effect.

Enable compression by manually updating the ApplicationHost.Config

  • On the CRM Server Navigate to: C:\Windows\System32\Inetsrv\Config\applicationHost.config and open it with notepad.
  • Locate the Section: “<httpCompression directory=” and in that section find a child node titled <dynamicsTypes> and an entry that looks like this:
    <add mimeType=”application/x-javascript” enabled=”true” />
  • Below that, add the following line:

<add mimeType=”application/soap+xml; charset=utf-8″ enabled=”true” />

  • Save the file and reset IIS for the setting to take effect.

Enable Compression in IIS using Configuration Editor

  • Open IIS on the CRM Server
  • Open Configuration Editor and navigate to the system.webServer/httpCompression Section

  • Choose dynamicTypes and open to add the new mimeType
  • Add a new item and enter application/soap+xml; charset=utf-8 as the mimeType.

  • Enable the mimeType and close the window.
  • Select Apply on the Configuration Editor and then reset IIS for the setting to take effect.

Note: Ensure you test this thoroughly in a test environment before configuring your production environment with this setting.


8 thoughts on “Optimise Dynamics CRM 2011 using WCF Compression

  1. bugsoli

    Hi Rhett,
    This is an interesting article, thank you so much!
    I’m currently testing this over on a client server, which has the DEV, TEST & PROD CRM instances on the same machine and I can surely say that it is already faster!
    They are using CRM 2011 in IFD mode so SSL is also on the way.
    Thanks again,

    1. Rhett Clinton MVP Post author

      Hi Oliver, you could record the results of a fiddler trace in a spreadheet of before and after for each of the settings to really see the benefits. Test loading a Contact form, Account form, etc,

      I’m glad you are getting good results.


  2. Brent

    Hi Rhett,

    Not sure if it is just me however the CMD Command didn’t work.
    The response I got was “ERROR ( message:Cannot find SITE object with identifier “charset=utf-8′,enabled=
    ‘true’]””. )”

    When using the dynamic type in ApplicationHost.Config the line should be more like

    1. Rhett Clinton MVP Post author

      Thanks for identifying that Brent, I will try and update it when I get a chance, hopefully you can just adjust using IIS Manager instead for the moment.


  3. Matt

    Thanks for this! Can anyone comment on why the use of SSL with the compression settings makes such a big difference in bandwidth usage? I get the compression side but don’t understand how SSL makes such a big difference.

    1. Rhett Clinton MVP Post author

      SSL encrypts and in most cases compacts the message before sending it over the wire. The performance hit is taken in encrypting/decrypting vs high network load.


  4. Pingback: Optimize Dynamics CRM 2011 using WCF Compression | Shivam Dixit Dynamics CRM Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.