Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static compression in IIS does not work for htm, js files

I'm trying to configure IIS 7.5 to compress static htm and js files. Does anyone know why it does not work for me? Here is my web.config for the web site:

    <httpCompression>          
        <dynamicTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/x-javascript" 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="*/*" enabled="false" />
        </staticTypes>
    </httpCompression>
    <urlCompression doStaticCompression="true" doDynamicCompression="false" />

Compression starts working when I set doDynamicCompression to true. But I can't use this option because it is disabled at my hosting.

Thank you.

like image 968
Evgenii Avatar asked Apr 01 '11 15:04

Evgenii


2 Answers

What makes you think the compression is not working? Check the Event View logs. Static Compression module will sometimes throw an error saying the directory being used is invalid (mostly because it needs write permissions).

Double check with Fiddler or another HTTP debugging tool to be sure that the client is sending "Accept-Encoding" of GZIP/Deflate.

like image 185
Tim P. Avatar answered Sep 28 '22 01:09

Tim P.


Enabling Http caching and compression in IIS 7 for asp.net websites - Anil Kasalanati

How about this? Checkyour applicationHost.config file.

like image 32
takepara Avatar answered Sep 28 '22 01:09

takepara