1

The sample configuration listed in Microsoft's documentation of the IIS system.webServer/httpCompression configuration setting is as follows:

<httpCompression
      directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
   <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="*/*" enabled="false" />
   </dynamicTypes>
   <staticTypes>
      <add mimeType="text/*" enabled="true" />
      <add mimeType="message/*" enabled="true" />
      <add mimeType="application/javascript" enabled="true" />
      <add mimeType="*/*" enabled="false" />
   </staticTypes>
</httpCompression>

What I'm not understanding is why their list of dynamic and static types are identical. Wouldn't you want a given MIME type to be deterministically registered as either dynamic or static, not both?

In the above example, I can't tell if application/javascript responses will be treated as dynamic or static because it's listed under both settings. Can someone shed some light on how this works?

Jacob Stamm
  • 1,660
  • 1
  • 29
  • 53
  • It really depends on the request URL that generates the response. Requests on static files triggers static compression. Read the article again and it covers that already. – Lex Li Sep 16 '20 at 20:15
  • @LexLi I understand that, but that still leaves my core question in the second half of my post unanswered. Why are these two lists of mime types identical? – Jacob Stamm Sep 16 '20 at 20:15
  • Why cannot they be the same? Responses on .js can be JavaScript, and responses generated by ASP.NET or PHP can also be JavaScript. – Lex Li Sep 16 '20 at 20:20
  • I think I’m starting to understand, but what I’m still not getting is how/where IIS elsewhere determines that a response is dynamic or static to begin with. – Jacob Stamm Sep 16 '20 at 20:29
  • That’s because you need to dig further into IIS via tools like failed request tracing. Static files are handled by a dedicate IIS component so static responses are easy to tell. Other responses are likely to be dynamic. – Lex Li Sep 16 '20 at 21:03
  • Ok thank you, I’ll do some more digging. If you have a recommended book or link to information on this topic, I’d greatly appreciate the tip. – Jacob Stamm Sep 16 '20 at 21:19
  • You might get some hints from https://learn.microsoft.com/en-us/iis/troubleshoot/performance-issues/troubleshooting-iis-compression-issues-in-iis6-iis7x – Lex Li Sep 17 '20 at 01:38

0 Answers0