I am building a web client that uses CesiumJS, where I load multiple Cesium3DTileset instances into the viewer. I have a need to reload tile content without reloading the entire tileset.
Today, this can be done by listening to tileLoad / tileUnload, keeping an external set of loaded tiles, and then manually setting expireDate on those tiles.
It would be cleaner if Cesium3DTileset exposed a supported API for expiring currently loaded tile content. Therefore, I am considering creating a PR that adds a Cesium3DTileset.expireLoadedTiles() function, but I wanted to get some feedback before starting the implementation.
The basic API could expire all currently loaded tile content:
tileset.expireLoadedTiles();
A more advanced version could also support expiring only loaded tiles that intersect a bounding sphere:
tileset.expireLoadedTiles({
boundingSphere: removedTileset.boundingSphere,
});
This could be useful when one tileset is removed and nearby or overlapping tiles in another tileset need to be refreshed.
The intention would be that Cesium only marks already-loaded tile content as expired, causing it to be re-requested through the normal tile expiration path. It would not reload the root tileset.json or rebuild the tileset hierarchy.
Does this seem like an API that would be useful for CesiumJS? Would this fit with how Cesium wants to expose tile cache/expiration behavior, or would there be a better approach?