Johannski:
Hi alex, thanks a lot for your answer, the breakdown is highly appreciated. I did quite some testing, here are my results:
Setup
System: Windows 10 pro 1909
Unity version: 2020.1.0b5
Project: https://github.com/JohannesDeml/UnityWebGL-LoadingTest
Compression Format: Brotli
Name Files as Hashes: False
Tested Browsers: Chrome, Firefox
General Problem
When using “Name Files as Hashes”, the js and wasm files will result in something like “b226dc4ae2feb1611aaf838cef9442b3.br”, so the extension information .js.br and .wasm.br gets lost, which of course breaks your .htaccess configuration. So that’s something you might want to look into (not hash the .wasm and .js away).
Unity’s simple webserver
Chrome:
Firefox:
Local XAMPP Server
Chrome:
Firefox:
Actual Webserver
Linux 3.10.0-962.3.2.lve1.5.25.12.el7.x86_64 x86_64 using LiteSpeed
Chrome:
Firefox:
So the webserver problem might be related to running on LiteSpeed instead of apache, so there might be different needs in how to write the .htaccess file (even though it worked for unity 2019.3 brotli compression).
On a sidenote, the compression and stripping does work better for 2020.1 (2.83 MB) compared to unity 2019.3 (3.28MB)
Thank you very much for pointing this out, Johannski. Using “Name Files as Hashes” does indeed strip away the “wasm” suffix which prevents the response header from being added correctly. For the same reason the “Name Files as Hashes” might also currently break multi-threaded builds. We are working on a resolution.