Suppose I have many calls to
sampleTerrainMostDetailed that hit the same terrain tile. (This Sandcastle is obviously a pathological example, but there are many reasons why you would want to do something similar to this, such as a live, high-detail elevation profile that updates in real time as the user drags across the screen.)
I was shocked to see that Cesium has no caching whatsoever for the terrain tiles. The tile is fetched anew every single time (for Cesium World Terrain, it hits the disk cache; for another terrain server I use, it actually downloads the tile every time!).
How can I approach this so Cesium doesn’t hit the network every time?
I don’t think I can use
scene.pickPosition because there is no guarantee the points in question will be on screen at any given time.
I am tempted to call the
CesiumTerrainProvider constructor supplying my own
Resource subclass with some of the key methods overridden, so that I can implement some kind of hacky LRU cache. Is there a less bad way to do this?