07/03/2026
A Unity WebGL build I received was 1.2 GB.
The project itself was not complex.
It was an interactive survey experience for breast cancer awareness.
The problem was how the content was delivered.
The application contained dozens of decision-based videos stored directly inside the Unity project.
Every user path triggered different video files, which caused the WebGL build to explode in size.
This created three problems:
1. Very slow loading times
2. High hosting costs
3. Poor user experience for survey participants
Instead of compressing everything inside Unity, I redesigned the delivery architecture.
What I changed
• Removed video assets from the Unity build
• Moved video delivery to Cloudflare R2 CDN
• Replaced local references with dynamic URLs
• Added fallback logic for failed video loading
• Built a lightweight Google Apps Script + Sheets logging system
Result
Build size reduced from 1.2 GB → 68 MB
Sometimes performance problems are not about optimization inside the engine.
They are about architecture decisions around the engine.
Full breakdown:
https://tinyurl.com/4ashc2zx