The idea
The opening teaser lasts sixty seconds. On a decent connection that is enough time to download and compile almost the whole game, so the loading happens there, while you watch, instead of after it. Before you click, almost nothing is downloaded. Opening the title page is kept under 2 MB, so someone who only came to look pays almost nothing.Measured on the live site
Wait after the film ends, before and after this work, with the longest main-thread stall in brackets.What changed
1
Ship the engine raw and let the edge compress it
The build writes its
.wasm uncompressed. Cloudflare’s edge encodes it on the way out, with zstd for Chrome and brotli for other browsers. Measured live: 22.4 MB raw, 8.0 MB with zstd, 7.9 MB with brotli. Pre-compressing it would have been worse: the edge was measured re-encoding files that were already compressed.2
Compile while downloading
The page compiles the engine with
WebAssembly.compileStreaming, so compilation starts with the first bytes rather than after the last, and hands the result to Unity’s loader. Browsers that cannot stream fall back to compiling a buffered copy.3
Split the data and let the browser inflate it
The game’s packed content is about 370 MB raw. It ships as 14 gzip parts, each at most 24 MiB to stay under Cloudflare’s 25 MiB per-file limit, named by content hash. The browser’s own
DecompressionStream inflates them, so no JavaScript decompressor ever blocks the main thread.4
Cache by build, not by luck
Unity’s own IndexedDB cache is switched off. The page keeps the parts in Cache Storage under the build’s hash, and every file under
/Build/ is served as immutable for a year. A returning visitor downloads nothing that has not changed.5
Make the engine smaller
Link-time optimisation for disk size, size-optimised IL2CPP code generation, high managed stripping (with the game’s own assemblies kept whole, because the page calls them by name), engine code stripping and no debug symbols took the engine from 44.6 MB to 22.4 MB with no measured loss in frame time.