In the past we have generally pointed people to look at the specific web server documentation for how to configure Content-Encoding, MIME and other CORS related web server fields correctly. Our documentation so far has only visited the very WebAssembly-specific Wasm Streaming configuration requirement (at https://docs.unity3d.com/Manual/Webgl-Server-configuration-for-WebAssembly-streaming.html )
Reading through the forums, it looks like this aspect causes a lot of general work, since different web servers all use different mechanisms to configure hosting. To make things more tedious, web browsers are introducing a new set of headers, COOP and COEP, slightly similar to CORS rules, for multithreaded applications.
We do now have Unity Connect that automates these aspects ( see Unity - Manual: WebGL Publisher ) so users targeting Unity Connect will have an easy time.
However to help other developers manage the manual work, I am wondering if this should be something that we would take on directly in Unity docs, or visit in a blog or forum entry. And if so, we would be looking to document the most commonly used web servers/hosting services that Unity game developers use, for most benefit to users.
Hence the poll: what web hosting (server software/service) are you using to host Unity content? Also, how easy was it to set up, e.g. for gzip compressed content? Was the needed info readily available for that system, or would it have helped to see specific documentation for that in Unity docs?
I like to use Netlify. It’s awesome and very easy to use! That’s what I use for testing. My clients always use AWS though. Here’s my .toml file for brotli compression.
Would like to see support easier/faster iteration of development builds locally as well.
Notably, allow users to bypass the “build & run” (which is almost useless as we often do quick template changes, manual file changes, passing data to/from a server - all taking much longer with build&run compared to just “refresh the browser”) while still leveraging its quick-spin-up webserver server.
In short, it would be beneficial to be able to find a way to spin-up Unity’s web server and to point it to a build without having to use “build & run”. Allowing us to fast iterate with multiple browsers and hot-modify the files the server uses while also testing a “gold standard” web-config for various compressions (GZip, Brotlit) - BEFORE having to deploy on our own webservers (local or not).
We use Amazon AWS S3 storage and our builds use brotli, which right now we have to manually set each file in the build folder appropriately in the AWS UI by clicking on a file and using their Actions → Change Metadata command.
Upload your brotli compressed Unity WebGL app to AWS S3 storage, and inside the build folder use the Change Metadata command on the following files… *.data.br - Set Content-Encoding to br and Content-Type to application/octet-stream *.framework.js.br - Set Content-Encoding to br and Content-Type to application/javascript *.loader.js - No need to change anything *.wasm.br - Set Content-Encoding to br and Content-Type to application/wasm
Eventually, our team will have to build out an automated way of doing this, especially because we want to someday support WebGL 2.0 on devices that allow it, and make builds with different technologies enabled without bloating the download size by including every technology in one build. That would be a lot of waiting around and a lot of manually setting things by hand.