We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Problem with static and dynamic compression [Answered]RSS

6 replies

Last post May 26, 2010 10:00 AM by member57123811

  • Problem with static and dynamic compression

    May 21, 2010 09:59 AM|member57123811|LINK

    Hi, i have read many post on this site about http compression, but i have some problem, yet.

    Compression doesn't function and i'm in trouble.

    My web server has Windows Server 2008 Enterprise SP2 with IIS 7.0.

    I have enabled dynamic compression in IIS (server level) and my applicaion.host has this "httpCompression" section:

            <httpCompression directory="d:\inetpub\temp\IIS Temporary Compressed Files">
                <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" dynamicCompressionLevel="7" staticCompressionLevel="9" />
                    <add mimeType="text/*" enabled="true" />
                    <add mimeType="message/*" enabled="true" />
                    <add mimeType="application/javascript" enabled="true" />
                    <add mimeType="*/*" enabled="false" />
                    <add mimeType="text/*" enabled="true" />
                    <add mimeType="message/*" enabled="true" />
                    <add mimeType="application/x-javascript" enabled="true" />
                    <add mimeType="*/*" enabled="false" />


    I have tried to insert this code in "staticTypes"

                    <add mimeType="application/x-javascript" enabled="true" />

    and this one in "dynamicTypes"

                   <add mimeType="application/javascript" enabled="true" />

    but no results.


    Could you help me, please?

    Many thanks for all helps


  • Re: Problem with static and dynamic compression

    May 21, 2010 11:20 AM|member57123811|LINK


    Connection Keep-Alive
    Content-Length 159956
    Date Fri, 21 May 2010 15:20:51 GMT
    Content-Type application/x-javascript
    Etag "bc3fd0cf940ca1:0"
    Server Microsoft-IIS/7.0
    Cache-Control max-age=2592000
    Last-Modified Tue, 29 Sep 2009 11:36:13 GMT
    Accept-Ranges bytes
    X-Powered-By ASP.NET
    <div class="netInfoHeadersGroup netInfoRequestHeadersTitle "> </div><div class="netInfoHeadersGroup netInfoRequestHeadersTitle "> </div><div class="netInfoHeadersGroup netInfoRequestHeadersTitle ">Request:
    Host www.site.com
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv: Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)
    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
    Accept-Encoding gzip,deflate
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive 115
    Connection keep-alive
    Cookie __utma=185092599.734216184.1274454462.1274454462.1274454462.1; __utmb=185092599.2.10.1274454462; __utmc=185092599; __utmz=185092599.1274454462.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)


    I have enabled 'Failed Request Tracing Rules' and look at the logs generated under the %SystemDrive%\inetpub\logs\FailedReqLogFiles folder. I'm seeing an entry called STATIC_COMPRESSION_NOT_SUCCESS in the log files generated and the error reason is 14 while description is NOT_FREQUENTLY_HIT.

    What is this?

  • Re: Problem with static and dynamic compression

    May 21, 2010 11:31 AM|member57123811|LINK

     Now i have inserted this code in applicationhost.config:

     <serverRuntime frequentHitThreshold="1" />

    and now the reason is "NO_MATCHING_CONTENT_TYPE"

  • Re: Problem with static and dynamic compression

    May 25, 2010 01:59 AM|member57123811|LINK

    Hi colleagues,

    any ideas for my problem?

    Many thanks and have a good day!

  • Re: Problem with static and dynamic compression

    May 26, 2010 04:16 AM|member57123811|LINK

     An additional information:



  • Re: Problem with static and dynamic compression

    May 26, 2010 04:25 AM|member57123811|LINK

    A news, if in Firefox i see with Live HTTP header i see this code:




    GET /layout/js/jquery.js HTTP/1.1
    Host: www.site.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv: Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)
    Accept: */*
    Accept-Language: it-it,it;q=0.8,en-us;q=0.5,en;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Connection: keep-alive
    Referer: http://www.google.com/
    Pragma: no-cache
    Cache-Control: no-cache


    HTTP/1.1 200 OK
    Connection: Keep-Alive
    Content-Length: 57254
    Date: Wed, 26 May 2010 08:20:37 GMT
    Content-Type: application/x-javascript
    Etag: "c7bcbcf940ca1:0"
    Server: Microsoft-IIS/7.0
    Cache-Control: max-age=2592000
    Last-Modified: Tue, 29 Sep 2009 11:36:13 GMT
    Accept-Ranges: bytes
    X-Powered-By: ASP.NET


    But i also looked in the IIS log in the GENERAL_REQUEST_HEADERS.  I do not see the Accept-Encoding Header.

    So, something is removing this before IIS is responding.

    Where can I look to see where/when this header is being removed?


  • Re: Problem with static and dynamic compression

    May 26, 2010 10:00 AM|member57123811|LINK

    I have found the solution.


    From my client's request and web server i have firewall ISA Server 2006 that removes Accept-Encoding Header before sends to IIS, so web server (IIS) receives request without correct header and it doesn't function.

    Configure ISA Server 2006 to allow IIS to compress the content, this approach does however require the disabling of the Compression Filter and Caching Compressed Content Filter in ISA Serve.


    Configure ISA Server to allow IIS 7.0 to compress the content

    To configure ISA to pass the Accept-Encoding header to the web server and allow IIS to compress content, perform the following steps (instructions are for ISA Server 2006, but apply in principle to ISA Server 2004 also):

    1. Disable the Compression Filter and Caching Compressed Content Filter

    • Start the ISA Server Management console
    • Select the Enterprise node in the tree-view, then Enterprise Add-ins
    • From the Web Filters tab, select Compression Filter
    • From the Tasks pane on the right, select Disable Selected Filters
    • Repeat the same process for Caching Compressed Content Filter

    2. Enable forwarding of the Accept-Encoding header

    • Copy + paste the VB Script below into notepad <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; font-family: monospace; font-size: 1.05em;">name = WScript.Arguments(0)
      Set fw = CreateObject("FPC.Root")
      Set rule = FW.GetContainingArray.ArrayPolicy.PolicyRules.Item(name)
      rule.WebPublishingProperties.SendAcceptEncodingHeader = True
      WScript.Echo "Forwarding of Accept-Encoding header enabled for " & name</div>
    • Save the file as called enable_isa_compression.vbs
    • Select the Firewall Policy node in the treeview under the Arrays node
    • Determine the name of the listener or publishing rule that you use to publish the website
    • From a command prompt, run: enable_isa_compression.vbs [name from step above]
    • If the function succeeds, you will see a message box stating success

    3. Click the Apply button to save the changes (it may take a few minutes for the changes to take effect)


    For more information, please refer to this Microsoft KB article: http://msdn.microsoft.com/en-us/library/ms826283.aspx


    Bye bye