WebGL - Deliver for all Platforms including iPhones

Hey guys,

I already figured out quite some things about the weird workings of WebGL and how to build projects, so they work on as many machines and devices as possible.
However, I am still facing a few issues, especially with Apple devices like iPhones.

Some key questions I have are the following:

  • What is the reason that the page is refreshing occasionally? I try to keep my games at 200-300mb when running, but for some reason some keep refreshing and some don’t
  • I have a webpage that contains an IFrame that loads the game. But within the game I want to switch to another minigame (another unity project), but when I do that (using the react-unity-webgl plugin from jeffrey lantern), it does not free up the memory even though I use the “unload()” method. Therefore, the memory keeps piling up and results in a crash
  • What are the best settings for building when having the goal of supporting all kinds of devices (desktops, laptops, android, ios), I am currently building 2 version of the game, one for desktops that use the DXT format and one for mobile that use ASTC format (build settings are shown below).

BTW: I am using Unity 2022.3.0 on Apple Silicon with M2 processor.

My player settings are the following:
Other settings:


Publishing settings are:
compression format: brotli
initial memory size: 256
growth mode: linear
power preference: High
Max memory size: 2048
Linear growth step: 16