Skip to content

Unity WebGL build size: a checklist from download to play

Investigate a large Unity WebGL build with a repeatable checklist for transferred bytes, asset costs, code stripping, compression headers, and first-play testing.

Published

4 min read

A smaller Unity WebGL download is valuable only if the game still starts reliably and plays correctly. Build-folder size, bytes transferred over the network, and time until the player can act are different measurements. Treating them as one number can send an optimization pass in the wrong direction.

This checklist is written for Unity 6 Web builds. Verify version-specific settings against the manual for the Editor you use. The aim is a controlled experiment: retain a working release, measure its first-play path, change one cause, and compare the same path again.

/01

Measure the path from an empty cache to first input

Start with a release build on a staging host configured like the intended production host. Record the build identifier, browser, device, network conditions, and whether the cache is empty. Note when the document loads, when the loader finishes, and when the player can actually control the game. Do not include a slow manual menu interaction in a measurement labeled engine startup.

Inspect the browser's network requests and save the transfer sizes for the largest files. Then repeat with a warm cache as a separate scenario. An imagined runner game might spend most of its initial download on music while a different project spends it on engine code. The next action should follow your own capture, not another project's reported savings.

/02

Investigate content costs before deleting assets

Make an inventory of the largest content groups in the resulting build and ask why each is needed before the first playable moment. Review large textures, long audio clips, duplicate content, and scenes that may have been included unintentionally. Keep an explanation for every proposed removal or quality change so the optimization remains reviewable.

Test quality reductions in context. A texture that looks acceptable in a thumbnail may make small interface text unreadable on a phone. An aggressively reduced audio file may damage an important cue. If optional content is loaded later, document the new failure and retry behavior as well as the smaller initial transfer; shifting cost does not remove the need to handle it.

/03

Treat managed code stripping as a behavior change

Unity's managed code stripping removes code that its analysis considers unused or unreachable. The process can reduce build size, but dynamically reached code may require explicit preservation. Unity documents both preservation attributes and link.xml configuration. Do not increase stripping settings and assume that a successful compilation proves every runtime path is safe.

Compare one stripping configuration at a time. Exercise serialization, content loading, menus, and third-party integrations in the resulting build. Keep narrowly scoped preservation rules alongside the reason they exist. If a change saves little and introduces difficult-to-reproduce failures, retaining the previous configuration can be the more useful release decision.

/04

Verify compression on the host, not just in the Editor

Unity's Web deployment settings and the server's response headers must agree. A precompressed build needs the appropriate Content-Encoding response for native browser decompression. Unity also provides a decompression fallback option with different hosting behavior. Consult the deployment manual for the chosen combination instead of copying a generic server configuration blindly.

Test the final staging URL through the same proxy or CDN that users will reach. Check status codes, response types, encoding, and whether a stale loader points at files from another release. A local build opening successfully does not prove that the public host serves its compressed files correctly. Keep a release-level rollback so related build files can be restored together.

/05

Set a budget and rerun the playable route

Choose a download and first-play budget for the devices and connections you support. It is a product decision, not a universal number. Save the baseline and candidate measurements with the test conditions so a later build can be compared meaningfully. Report both wins and tradeoffs, including reduced quality or additional loading states.

Finish with a cold start, warm start, level transition, restart, and return visit on a representative device. Verify the loading UI remains understandable when the connection is slow or a request fails. AgentGuild's Unity WebGL optimization and portal-readiness workflows help organize these checks, but the evidence should always come from the hosted build you intend to release.

Keep this in mind

Key takeaways

  • Measure transferred bytes and time to first playable input separately.
  • Change one asset, stripping, or compression decision at a time and preserve the known-good build.
  • Validate the deployed headers and complete gameplay paths before accepting a smaller release.

Sources & further reading

Consult the source documentation for the version and platform you are working with.