Brotli compression didn't work as expected

246 Views Asked by At

Im having a weird problem with brotli compression on my iis 10 server.

for example some file getting passed with BR compression and some not.

this is my config on server :

1st ive installed this package and activate it with guide in it : Microsoft IIS Compression (x64)

2nd ive made this config in my applicationHost.config inside C:\Windows\System32\inetsrv\config : (commenting gzip section to force br)

 <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
        <scheme name="br" dll="%ProgramFiles%\IIS\IIS Compression\iisbrotli.dll" />
        <!--<scheme name="gzip" dll="%ProgramFiles%\IIS\IIS Compression\iiszlib.dll" />-->
        <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>
    </httpCompression>

3rd ive add this file to my asp.net project web.config file :

<urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true" />
<httpCompression sendCacheHeaders="true" minFileSizeForComp="256" noCompressionForHttp10="false" noCompressionForProxies="false" noCompressionForRange="false" staticCompressionIgnoreHitFrequency="true" staticCompressionEnableCpuUsage="0" dynamicCompressionDisableCpuUsage="100" dynamicCompressionEnableCpuUsage="0" />

4th ive checked this folder for compressed br file : (C:\inetpub\temp\IIS Temporary Compressed Files\Bonobo$^_br_D^\BONOBOPROJECT\CONTENT\DIST)

enter image description here

5th when i test my app.lib.min.js file in browser it shows correct size : (BR size) but some file passed with normal uncompressed size.

Update when i try with mutliple ip address in same time on files it passed the BR correct one. how can i make iis to serve BR file all them time instead of waiting for multiple different IP request? ive set staticCompressionIgnoreHitFrequency to true based on this document HTTP Compression but still it need multiple different hit to gives the BR version of file.

0

There are 0 best solutions below