IIS compression does not work [Answered]RSS

3 replies

Last post Jul 28, 2020 01:17 AM by Jalpa Panchal

  • IIS compression does not work

    Jul 25, 2020 06:01 AM|zipswich333|LINK

    The compression is enabled in IIS of Windows 10 Pro:

    The following is in web.config:

    <httpCompression
    directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
    minFileSizeForComp="1"
    staticCompressionIgnoreHitFrequency="true"
    dynamicCompressionIgnoreHitFrequency="true">
    <dynamicTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/javascript" enabled="true" />
    <add mimeType="image/*" enabled="true" />
    <add mimeType="application/wasm" enabled="true" />
    <add mimeType="*/*" enabled="true" />
    </dynamicTypes>
    <staticTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="image/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/javascript" enabled="true" />
    <add mimeType="application/wasm" enabled="true" />
    <add mimeType="*/*" enabled="true" />
    </staticTypes>
    </httpCompression>

    I have found only JavaScript files are compressed:

    Other files such as WASM are not compressed:

    Could anyone shed some light on this?

  • Re: IIS compression does not work

    Jul 27, 2020 02:55 AM|Jalpa Panchal|LINK

    Hi,

    IIS doesn't compress content until it is hit frequently, so it may appear that content is not compressed when it actually will be eventually after it's been hit a few times.

    Additionally, make sure that your mime types listed match the content types you're passing back from your code EXACTLY. also enable compression at the site level.

    Enable Failed request tracing would be the best way to troubleshooting this issue.

    1) Install failed request tracing in add role and feature->Web Server->health and diagnostics->tracing

    2) Open IIS manager->go to your site node->failed request tracing->add..->all content->status code 100-500->ensure WWW Server/compression has been checked->finish.

    3) Edit site tracing->Enable.

    4) Open the log file in C:\inetpub\logs\FailedReqLogFiles\ and check the dynamic compression procedure.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Re: IIS compression does not work

    Jul 27, 2020 02:16 PM|zipswich333|LINK

    Thank you very much for your help.  I struggled to enable Failed request tracing, but never saw any log. 

    An SO answer helped solve the problem yesterday. 

  • Re: IIS compression does not work

    Jul 28, 2020 01:17 AM|Jalpa Panchal|LINK

    I am glad that your issue is resolved. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.