I have created a WebGL build of my game, and hosted it on my own server.
It does run and works fine, however it shows a yellow dialog box saying:
HTTP Response Header “Content-Type” configured incorrectly on the server for file Build/PopSquaresWeb.wasm.gz , should be “application/wasm”. Startup time performance will suffer
# NOTE: "mod_mime" Apache module must be enabled for this configuration to work.
<IfModule mod_mime.c>
# The following lines are required for builds without decompression fallback, compressed with gzip
RemoveType .gz
AddEncoding gzip .gz
AddType application/gzip .data.gz # The correct MIME type here would be application/octet-stream, but due to Safari bug https://bugs.webkit.org/show_bug.cgi?id=247421, it's preferable to use MIME Type application/gzip instead.
AddType application/wasm .wasm.gz
AddType application/javascript .js.gz
AddType application/octet-stream .symbols.json.gz
# The following lines are required for builds without decompression fallback, compressed with Brotli
RemoveType .br
RemoveLanguage .br
AddEncoding br .br
AddType application/octet-stream .data.br
AddType application/wasm .wasm.br
AddType application/javascript .js.br
AddType application/octet-stream .symbols.json.br
# The following line improves loading performance for uncompressed builds
AddType application/wasm .wasm
</IfModule>
This now works with gz compression with no dialogs.
However it does break the uncompressed build
WebAssembly streaming compilation failed! This can happen for example if "Content-Encoding" HTTP header is incorrectly enabled on the server for file Build/PopSquaresWeb.wasm, but the file is not pre-compressed on disk (or vice versa). Check the Network tab in browser Devtools to debug server header configuration.
and the Brotli compressed build
Unable to parse Build/PopSquaresWeb.Brotli.framework.js.br! This can happen if build compression was enabled but web server hosting the content was misconfigured to not serve the file with HTTP Response Header "Content-Encoding: br" present. Check browser Console and Devtools Network tab to debug.
see, no offence @MarcelPursche this is why unity is such a pain in the fluff for webgl people, it changes, a while back this was essential, or it didnt work.. we have to force webservers to send your data in a way that isnt natural, when it should be natural..
anything that is .gz should be just gzip, anything that is wasm should be wasm, why is it always changing and always complicated?