2

I have followed this document and have enabled both Dynamic and Static compression for my website.

enter image description here

But when I test the website here, the compression is not enabled.

enter image description here

I have verified the HttpCompression:

<system.webServer>
  <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
    <staticTypes>
      <add mimeType="text/*" enabled="true" />
      <add mimeType="message/*" enabled="true" />
      <add mimeType="application/javascript" enabled="true" />
      <add mimeType="application/atom+xml" enabled="true" />
      <add mimeType="application/xaml+xml" enabled="true" />
      <add mimeType="image/svg+xml" 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="application/javascript" enabled="true" />
      <add mimeType="*/*" enabled="false" />
    </dynamicTypes>
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
  </httpCompression>
</system.webServer>

I have also checked the following IIS Settings: enter image description here

Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137
  • https://learn.microsoft.com/en-us/iis/troubleshoot/performance-issues/troubleshooting-iis-compression-issues-in-iis6-iis7x – Lex Li May 10 '21 at 14:07
  • For information about "Using IIS Compression", you can refer to this link: https://learn.microsoft.com/en-us/iis/extensions/iis-compression/using-iis-compression – Ding Peng May 11 '21 at 05:58

1 Answers1

1

I see from your posted headers that the site is behind cloudfront (ie the via and x-cache headers).

Thus you may need to investigate having cloudfront provide compressed data: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html

I'm not particularly familiar with cloudfront, but since its adding the via header its acting as a proxy..

..you have noCompressionForProxies = True in your IIS settings screenshot.

This has some info on changing that setting https://community.spiceworks.com/topic/1989103-help-with-enabling-nocompressionforproxies-in-applicationhost-config-in-iis

As a 1st test you could try to hit your site by-passing cloudfront to directly test the IIS setup.

tolanj
  • 3,651
  • 16
  • 30
  • Thanks a lot... you saved me :-) It never occurred to me that this is because I am using **Elastic Load Balancer**... setting `noCompressionForProxies = False` solved the issue. I will award the bounty at the end of its period. – Hooman Bahreini May 14 '21 at 04:02