Increase Terrain Cache?

1. A concise explanation of the problem you’re experiencing.

When rotating the camera around in the same location, with Cesium World Terrain activated, Cesium seems to re-load everything within view, instead of caching it on memory. Given it takes a few seconds to load the terrain, this significantly affects usability, as merely rotating the camera requires the user to wait a few seconds for the terrain to load.

Is there a way to increase the memory cache size, such that the local terrain does not have to be re-loaded as the camera is rotated?

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Rotate camera around with mouse, notice that terrain is continuously re-loaded.

LINK

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I want the user to have a smooth experience viewing the terrain (viewing a single location of the terrain, but turning the camera around); if it needs to be re-loaded as the camera turns around, this will significantly degrade user experience.

4. The Cesium version you’re using, your operating system and browser.

Latest Cesium, Chrome browser, Chromebook.

Thanks!

You can indeed control this! The easiest way is just to bump up the tileCacheSize (see https://cesium.com/docs/cesiumjs-ref-doc/Globe.html?classFilter=globe#tileCacheSize).

For your specific situation I think setting preloadSiblings to true would help a lot:

https://cesium.com/docs/cesiumjs-ref-doc/Globe.html?classFilter=globe#preloadSiblings

There’s also preloadAncestors which is on by default:

https://cesium.com/docs/cesiumjs-ref-doc/Globe.html?classFilter=globe#preloadAncestors

This worked, thank you very much sir!!

Glad to hear that!!

What kind of project are you working on?