How to fix err_content_decoding_failed during dynamic compression?

I am working on an ASP.Net website and am currently optimizing it. I am trying to enable dynamic compression of content, but this will not work.

I get

Error 330 (net :: ERR_CONTENT_DECODING_FAILED): Unknown error.

  • In my development environment, it works well.

    • I built the project in release mode. I added a dynamic content compression module, turned on dynamic content compression and checked that this is what I get.
  • I have an AWS EC2 server with Windows Server 2008 R2 with IIS installed.

    • I created the project in release mode and published it to a folder that I am deploying to the server.
    • I tried with the same web.config file as on the developer's machine, but no luck there

Added this to web.config:

<httpCompression
    directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
    dynamicCompressionDisableCpuUsage="90"
    dynamicCompressionEnableCpuUsage="80"
    maxDiskSpaceUsage="100" minFileSizeForComp="2700"
    noCompressionForRange="true"
    sendCacheHeaders="false"
    staticCompressionDisableCpuUsage="100"
    staticCompressionEnableCpuUsage="80"
    >
    <scheme name="gzip"
        dll="%Windir%\system32\inetsrv\gzip.dll" />
    <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/javascript" enabled="true" />
        <add mimeType="application/json" enabled="true" />
        <add mimeType="application/xml" 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/json" enabled="true" />
        <add mimeType="application/atom+xml" enabled="true" />
        <add mimeType="application/rss+xml" enabled="true" />
        <add mimeType="application/xaml+xml" enabled="true" />
        <add mimeType="application/xml" enabled="true" />
        <add mimeType="image/svg+xml" enabled="true" />
        <add mimeType="*/*" enabled="false" />
    </staticTypes>
</httpCompression>
<urlCompression doDynamicCompression="true" />

- , ?

.

EDIT: : " .

GZip . , GZip.

+5
4

, , IIS / - :

  • inetmgr
  • , .
  • Cache
+7

.

. SomeOtherApplicationPoolIdentity.

, - ( , IIS , IIS, node, ""; %SystemDrive%\inetpub\temp\IIS Temporary Compressed Files):

enter image description here

%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files SomeOtherApplicationPoolIdentity, , , IIS_IUSRS, SYSTEM, Administrators .

+2

- , ( - ) "% SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"

0

dynamicCompressionBeforeCache = "false"

dynamicCompressionBeforeCache = "true", , - , ...

<!--http://www.iis.net/configreference/system.webserver/urlcompression-->
<urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="false" />
<httpCompression 
  directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
  dynamicCompressionDisableCpuUsage="90"
  dynamicCompressionEnableCpuUsage="80"
  maxDiskSpaceUsage="100"
  minFileSizeForComp="2700"
  noCompressionForRange="true"
  sendCacheHeaders="false"
  staticCompressionDisableCpuUsage="100"
  staticCompressionEnableCpuUsage="80">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
    <dynamicTypes>
      <add mimeType="text/*" enabled="true" />
      <add mimeType="message/*" enabled="true" />
      <add mimeType="application/javascript" enabled="true" />
      <add mimeType="application/json" enabled="true" />
      <add mimeType="application/xml" 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/json" enabled="true" />
      <add mimeType="application/atom+xml" enabled="true" />
      <add mimeType="application/rss+xml" enabled="true" />
      <add mimeType="application/xaml+xml" enabled="true" />
      <add mimeType="application/xml" enabled="true" />
      <add mimeType="image/svg+xml" enabled="true" />
      <add mimeType="*/*" enabled="false" />
    </staticTypes>
</httpCompression>

http://www.iis.net/configreference/system.webserver/urlcompression

dynamicCompressionBeforeCache , IIS , . dynamicCompressionBeforeCache - true, IIS . , . , . dynamicCompressionBeforeCache , IIS , .

Note. If the dynamicCompressionBeforeCache attribute is true, if the response of the output cache has been discarded, dynamic compression will not be performed before the response is placed in the output cache. However, if the doDynamicCompression attribute is true, dynamic compression will still occur after the response cache has popped up.

0
source