title: iis7 compress dynamic content from custom handler
body: <p>I am having trouble getting dynamic content coming from a custom handler to be compressed by IIS 7. </p>
  
  <p>Our handler spits out json data (Content-Type: application/json; charset=utf-8) and responds to url that looks like: domain.com/example.mal/OperationName?Param1=Val1&amp;Param2=Val2</p>
  
  <p>In IIS 6, all we had to do was put the edit the MetaBase.xml and in the IIsCompressionScheme element make sure that the HcScriptFileExtensions attribute had the custom extension 'mal' included in it.</p>
  
  <p>Static and Dynamic compression is turned out at the server and website level.
  I can confirm that normal .aspx pages are compressed correctly.
  The only content I cannot have compressed is the content coming from the custom handler.</p>
  
  <p>I have tried the following configs with no success:</p>
  
  <pre><code>&lt;handlers&gt;
    &lt;add name="MyJsonService" verb="GET,POST" path="*.mal" type="Library.Web.HttpHandlers.MyJsonServiceHandlerFactory, Library.Web" /&gt;
  &lt;/handlers&gt;
  
  &lt;httpCompression&gt;
    &lt;dynamicTypes&gt;
      &lt;add mimeType="application/json" enabled="true" /&gt;
    &lt;/dynamicTypes&gt;
  &lt;/httpCompression&gt;
  </code></pre>
  
  <p>_</p>
  
  <pre><code>&lt;httpCompression&gt;
    &lt;dynamicTypes&gt;
      &lt;add mimeType="application/*" enabled="true" /&gt;
    &lt;/dynamicTypes&gt;
  &lt;/httpCompression&gt;
  </code></pre>
  
  <p>_</p>
  
  <pre><code>&lt;staticContent&gt;
    &lt;mimeMap fileExtension=".mal" mimeType="application/json" /&gt;
  &lt;/staticContent&gt;
  &lt;httpCompression&gt;
    &lt;dynamicTypes&gt;
      &lt;add mimeType="application/*" enabled="true" /&gt;
    &lt;/dynamicTypes&gt;
  &lt;/httpCompression&gt;
  </code></pre>
  
  <p>Thanks in advance for the help.</p>