So here is the summary of my 2 weeks investigation with cloud engineers and others with serving compressed WebGL unity builds:
In version 2019 the compressed builds(gzip&brotli) can be served without any problem (in computers).
In version 2020 the compressed builds can not be served with error ( Uncaught ReferenceError:unityFramework is not defined at HTMLScriptElement.r.onload ).
In version 2021 the compressed builds can not be served with error (Header with Content-Encoding: (gzip or br) is missing)
Even after trying to tackle the errors with changes in the configuration files and adding .htaccess files, i haven’t managed to solve them. Please feel free to say solutions/thoughts! Thank you.
Hello eIZach ! Exactly! So i use aws servers to host the builds. I’ve tried both apache/nginx without any luck. I am sure unity engineers are aware of this issue. It’s indeed weird.
UPDATE:
According to Unity’s documentation “WebGL: Compressed builds and server configuration” it’s a recommended solution to enable decompression fallback “…if you have less experience with server configuration, or if server configuration is unavailable to you…Note: Using this option results in a larger loader size and a less efficient loading scheme for the build files.”