So here’s a bit of a file optimization question. I am working on a project with multiple somewhat large scenes, and I’ve opted to place a preloader in each one that dynamically loads the assets on scene load.
I’ve noticed that when self hosting, the large number of scripts sometimes do not respond to app events when combined with the website’s own js fighting for resources. Since I’m not preloading my scripts, they are not concatenated on publish, which means a large number of GET calls as each scene loads.
I see a couple of different options here, but I’m curious to see which would be the most recommended.
Option 1:
Do nothing. Work to keep the number of scripts as low as possible, and continue to load them as needed by scene.
Option 2:
Pre-load all of the scripts and let Playcanvas concatenate them into one big file.
Option 3: Concatenate individual scene scripts into one file per scene, and load that single file on scene load.
I’m leaning toward Option 3, but I’m wondering if there is something fundamental about this choice that would make me want to avoid it.
Any insight is greatly appreciated!