Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is actually pretty easy to do this, at least with .NET 4.0 (I didn't test with 3.5). What I do is just let IIS 7 take care of it. There is no need to create a custom compression filter.</p> <p>First, make sure you have installed the Dynamic Compression feature for IIS 7. Then, select the server in IIS Manager and use the compression module to turn on Dynamic Compression. Alternatively, you can do this from the command line:</p> <pre><code>C:\windows\system32\inetsrv\appcmd set config -section:urlCompression /doDynamicCompression:true </code></pre> <p>Next, edit the following file. You may have to make a copy of it rather than editing the config directly (Notepad++ complains for me), then overwrite the original when you are ready.</p> <pre><code>C:\Windows\System32\Inetsrv\Config\applicationHost.config </code></pre> <p>In there you will find a &lt;dynamicTypes&gt; section under &lt;httpCompression&gt;. Under &lt;dynamicTypes&gt; you will need to add all the mime types you want to be compressed when the client sends an Accept-Encoding: gzip header. For example:</p> <pre><code>&lt;dynamicTypes&gt; &lt;add mimeType="text/*" enabled="true" /&gt; &lt;add mimeType="application/xml" enabled="true" /&gt; &lt;add mimeType="application/json" enabled="true" /&gt; &lt;add mimeType="message/*" enabled="true" /&gt; &lt;add mimeType="application/x-javascript" enabled="true" /&gt; &lt;add mimeType="*/*" enabled="false" /&gt; &lt;/dynamicTypes&gt; </code></pre> <p>Once you've done all that, recycle your application pool and you should be good to go. If that doesn't work, try restarting your server and ensuring that dynamic compression is turned on at the application level as well as the server level.</p> <p><em>Note: According to some posts I've read, there used to be a bug where you had to specify the character encoding (e.g., "application/json; charset=utf-8"). However, I didn't have any problems.</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload