I am using Visual Studio 2012 running on Windows 8. I have a WCF Service hosted in IIS Express for which the default page is MyService.svc and I have a client app which makes an HTTP Get request to that URI. The client sets the Accept header on the request to "application/json;odata=verbose" and my service duly returns a big block of JSON to my client.
But now I want to test HTTP compression, so on the client, I now set the AcceptEncoding header to "gzip,deflate".
In [MyDocuments]\IISExpress\config\applicationhost.config, I have added "application/json" into the <dynamicTypes> inside <httpCompression...> section:
<httpCompression directory="%TEMP%\iisexpress\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%IIS_BIN%\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
When I test this, I see the following in the tracelog:
153. | DYNAMIC_COMPRESSION_START | 20:20:26.715 | |
154. | DYNAMIC_COMPRESSION_NOT_SUCCESS | Reason="NO_MATCHING_SCHEME" | 20:20:26.715 |
155. | DYNAMIC_COMPRESSION_END | 20:20:26.715 |
From what reading I've done, I could only find advice for 'big' IIS which suggests that IIS 8 only compresses certain file extensions: "compress(es) htm, html, and txt for STATIC compression, and asp, dll, and exe for DYNAMIC compression". Looks to me like IIS Express will not compress my ".svc" .
Is that it - is it the .svc file extension that is the problem. If it is, how do I persuade IIS Express to compress the output from my WCF Service?