Content download take so long in project


After I released the project, I found that many smaller files, including files of more than 10 kb and more than 100 kb, would take too long to download.The server also has static resource acceleration (CDN),When the page is loaded to 100%, the page sometimes gets stuck.
Is there any better optimization scheme for this problem?

Is there an optimization setting in the engine?

Hi @leooooooo,

If you have a CDN serving the files, then most likely that’s where you should be looking for the long download times.

The delay you observe after the page is loaded at 100% may be coming from something else e.g. compiling shaders or creating mesh colliders. That’s a blocking operation. If you have a build url that you are able to share, we can give it a try too.

this link:ARIYA

It doesn’t feel like there is a CDN serving the files as it’s taking a while in the UK:

You are also loading 511 separate files/requests so some requests are more than likely being blocked by others, which means it is taking longer despite being a small size. Or it could be failing and being retried as well.

The total download time in your locations is 3.77 s for 31MB and 436 requests which is pretty good

Side note. Having that many requests can lead to errors of loading assets because the browser can’t handle that many requests. You may want to consider loading in batches or looking at how to reduce the number of files you reall need:

As Leonidas mentioned, this is likely due to be for shader compiling to render the first frame. I recommend profiling in the browser to see what it actually is

Looking at the profiler, it looks like it is due the shaders for the materials being compiled for the first frame:

if I close the preload and load in a specific time,is that what you say ‘loading in batches’?
for example:I tag the asset and load it and display it when necessary
image

What I would personally do on my projects is get the user pass the preload screen as fast as possible.

I would load the minimum needed to get them into a 3D rendered scene and then load parts of the model/world/game in groups of assets, especially if there are 400+ assets to be loaded.

For example. In this case, I would load the UI and environment (cubeamp, mesh) first in the preload and get the user into the scene.

Once in the scene, add some sort of loading progress/icon where the car would be and load the body first. Once that is done, load the assets for the wheels. etc etc

The car will gradually be rendered bit by bit but the user will see the progress rather than just a loading screen.

This company uses this process quite well: Build Your SxS | Polaris RZR

This is really a great example!I will make a good reference and think about how to optimize it!Thank you!By the way,how feasible is the above code fragment for batch loading?

I wouldn’t have partialNum and Sum as globals but otherwise, yes.

You can look at this scene load example for something similar Loading Scenes | Learn PlayCanvas

ok,I get it! Thank you! :grinning: