locked
Problem with static and dynamic compression RRS feed

  • Question

  • User949777683 posted

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

     

    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

    Mark

    Friday, May 21, 2010 9:59 AM

Answers

  • User949777683 posted

    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
      name = WScript.Arguments(0)
      Set fw = CreateObject("FPC.Root")
      Set rule = FW.GetContainingArray.ArrayPolicy.PolicyRules.Item(name)
      rule.WebPublishingProperties.SendAcceptEncodingHeader = True
      rule.Save
      WScript.Echo "Forwarding of Accept-Encoding header enabled for " & name
    • 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

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, May 26, 2010 10:00 AM

All replies

  • User949777683 posted

    Response:

    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
     
     
    Request:
    Host www.site.com
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.3) 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?

    Friday, May 21, 2010 11:20 AM
  • User949777683 posted

     Now i have inserted this code in applicationhost.config:

     <serverRuntime frequentHitThreshold="1" />

    and now the reason is "NO_MATCHING_CONTENT_TYPE"

    Friday, May 21, 2010 11:31 AM
  • User949777683 posted

    Hi colleagues,

    any ideas for my problem?

    Many thanks and have a good day!

    Tuesday, May 25, 2010 1:59 AM
  • User949777683 posted

     An additional information:

     this reason is raised on "STATIC_COMPRESSION_NOT_SUCCESS", while "DYNAMIC_COMPRESSION_NOT_SUCCESS" tells "NO_ACCEPT_ENCODING".

     

    Wednesday, May 26, 2010 4:16 AM
  • User949777683 posted

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

     

    http://www.site.com/jquery.js


    Request.

    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:1.9.2.3) 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


    Response:

    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?

     

    Wednesday, May 26, 2010 4:25 AM
  • User949777683 posted

    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
      name = WScript.Arguments(0)
      Set fw = CreateObject("FPC.Root")
      Set rule = FW.GetContainingArray.ArrayPolicy.PolicyRules.Item(name)
      rule.WebPublishingProperties.SendAcceptEncodingHeader = True
      rule.Save
      WScript.Echo "Forwarding of Accept-Encoding header enabled for " & name
    • 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

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Wednesday, May 26, 2010 10:00 AM