jeffreylanters / react-unity-webgl

React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.
https://react-unity-webgl.dev
Apache License 2.0
1.75k stars 162 forks source link

Very slow loading times on production server #426

Closed alexisdavidson closed 2 years ago

alexisdavidson commented 2 years ago

Please avoid duplicates

Language and Compiler

Vanilla JavaScript

What environment are you using?

Static File Serving

When does your problem occur?

While the Unity App is loading

What does your problem relate to?

The problem seems Unity related

React-Unity-WebGL Version

9.0.3

React Version

17.0.2

Unity Version

2021.3.3f1

What happened?

On my local machine, le loading is very fast and almost instantaneous. Now I uploaded everything on a ubuntu server and everything works but the loading is now extremely slow at times (not always the same). Are the game files not cached? is 70 MB huge for a game?

Reproducible test case

No response

Would you be interested in contributing a fix?

jeffreylanters commented 2 years ago

Hi. Caching is completely depending on your server's configuration. 70mb is quite big for a WebGL build, but it depends on it's purpose. I would recommend keeping it under around 30mb.

I hope this helps! Happy coding.