I'm having trouble getting dynamic content coming from a custom handler for IIS 7 compression.
Our handler spits out json data (Content-Type: application / json; charset = utf-8) and responds to a url that looks like this: domain.com/example.mal/OperationName?Param1=Val1&Param2=Val2
In IIS 6, all we had to do was edit the MetaBase.xml file and in the IIsCompressionScheme element so that the HcScriptFileExtensions attribute contained the user extension 'mal' in it.
Static and dynamic compression is obtained at the server and website level. I can confirm that normal .aspx pages are compressed correctly. The only content that I cannot compress is the content coming from a custom handler.
I tried the following configurations without success:
<handlers>
<add name="MyJsonService" verb="GET,POST" path="*.mal" type="Library.Web.HttpHandlers.MyJsonServiceHandlerFactory, Library.Web" />
</handlers>
<httpCompression>
<dynamicTypes>
<add mimeType="application/json" enabled="true" />
</dynamicTypes>
</httpCompression>
_
<httpCompression>
<dynamicTypes>
<add mimeType="application/*" enabled="true" />
</dynamicTypes>
</httpCompression>
_
<staticContent>
<mimeMap fileExtension=".mal" mimeType="application/json" />
</staticContent>
<httpCompression>
<dynamicTypes>
<add mimeType="application/*" enabled="true" />
</dynamicTypes>
</httpCompression>
Thanks in advance for your help.
source
share