TFS2010: How to enable compression for SOAP traffic

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

TFS2010: How to enable compression for SOAP traffic

  • Comments 0

When we upgraded our internal servers to TFS2010, some of our remote users noticed that HTTP compression was used for some traffic, but not all. HTTP compression was enabled for file downloads from source control and for web access pages but we weren’t compressing the SOAP responses to clients for Work Item Tracking and other API commands.  This only applies when installing TFS2010 on Windows 2008, Windows 2008 R2 and Windows 7 - it will be enabled by default in a future release.

To make this change for yourself, logon to your application tier, open a command prompt as administrator, paste the following commands:

%windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/soap%u002bxml; charset=UTF-8',enabled='True']" /commit:apphost
%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:"Microsoft Team Foundation Server Application Pool"

Some investigation revealed that the IIS “Dynamic Compression” feature is getting installed and enabled correctly but we’re missing the MIME type for the SOAP requests.  Here’s an example from the installation log file:

[Info   @01:11:43.140] IIS7 Feature value: CompressionBinaries=1

[Info   @01:11:43.140] IIS7 Feature value: HttpCompressionDynamic=1

[Info   @01:11:43.140] IIS7 Feature value: HttpCompressionStatic=1

[Info   @01:22:21.295] Configuring dynamic compression on IIS7

[Info   @01:22:21.295] Process starting: fileName=C:\Windows\system32\inetsrv\appcmd.exe arguments=set config -section:urlCompression /doDynamicCompression:true

[Info   @01:22:21.999] Process finished: fileName=C:\Windows\system32\inetsrv\appcmd.exe arguments=set config -section:urlCompression /doDynamicCompression:true exitCode=0 in 701 ms

[Info   @01:22:21.999] Applied configuration changes to section "system.webServer/urlCompression" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"

The easiest way to verify that compression is correctly enabled is to look at a network trace using a tool like Network Monitor (NetMon). Fiddler doesn’t work with the default configuration of Visual Studio, because it is set to “BypassProxyOnLocal”.

Here’s what the NetMon trace looks like without compression. Notice that the HTTPPayloadLine is in cleartext.

image

And here’s what it looks like after compression is enabled – the payload is GZip compressed.

image