Why does my javascript file sometimes compressed while sometimes not?(IIS Gzip problem)

Posted by Kevin Yang on Stack Overflow See other posts from Stack Overflow or by Kevin Yang
Published on 2010-05-06T07:01:42Z Indexed on 2010/05/08 9:58 UTC
Read the original article Hit count: 260

Filed under:
|
|
|
|

i enable gzip for javascript file in my iis settings, here 's the corresponding config section.

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
        <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="10" dynamicCompressionLevel="8" />
        <dynamicTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
  <add mimeType="application/soap+msbin1" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </dynamicTypes>
        <staticTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/javascript" enabled="true" />
  <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </staticTypes>
    </httpCompression>

currently, when i download my js file, it seems that sometimes server return the gzip one, and sometimes not. i dont know why, and how to debug that.

If a file is already gzipped, it should be cached in local disk, and next time someone visit that file again, iis kernel should return the cache gzip file directly without compressing it again. Is that right?

© Stack Overflow or respective owner

Related posts about iis

Related posts about gzip