I want to server some static contents to browser and found that Brotli reduces the size of final download package by 43% compare to gzip.
I first tried by setting up only Brotli and all modern browser download the compressed file. But when tried with IE11 (which doesn't support brotli), download original contents without any compression which impact performance.
To handle this, I kept both Gzip and Brotli on IIS. But now all browser downloads the contents only in Gzip format most probably because of the request header order where gzip comes first.
I want to make it conditional so that by default browser download the contents in Brotli format and if browser doesn't support it then switch to gzip format automatically.
Any idea how to do it?
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<scheme name="br" dll="%Windir%\system32\inetsrv\brotli.dll" dynamicCompressionLevel="5" staticCompressionLevel="11" />
<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>
<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>