When working in Cesium Native, is there a way to forcibly reload a tiles content even while it is visible in its current view group?
I am working with a custom data set that I am loading in Cesium for Unreal via a tileset.json. Occasionally, the data set may be updated on the server, which means my client has an outdated view. The tiles that have been updated may or may not be in the calculated `ViewStates`, which means I may need to reload tiles.
Assuming the server knows and tells the client which specific tiles were updated, and that I do not want to reload the entire tileset, is it possible to / how would I mark those tiles as needing reloading? I know CesiumJS has expireDate and some other similar mechanisms to cause the runtime to reload those tiles, but as far as I can tell, a similar methodology does not exist for CesiumNative based tilesets.
If CesiumNative does have support for this, what would I need to do to start the reloading process? Is the process seamless? Meaning, is the previous tile kept as renderable and loaded from the perspective of tilesToRenderThisFrame, or is it evicted right away?
If this type of reloading is not supporting, what would need to be done to add it? How much complexity would a seamless reloading requirement add to the work needed?
I think you’re right that there isn’t a per-tile equivalent to CesiumJS’s expireDate / expireDuration in Cesium Native. I’m not aware of a public API to mark a single loaded tile as stale and re-fetch it in place while it stays on screen.
A few directions you could take, roughly easiest to hardest:
Reload a fresh tileset in the background, then swap. When your server signals an update (a webhook or similar), load a second tileset from the updated tileset.json, wait until it’s ready, and swap it in for the old one. This is the easiest since it lives entirely in your application, but you will use more memory/bandwidth from having two copies during the swap.
Invalidate the cache for the changed tiles. On the update signal, expire just those tiles’ cache entries so the next request re-fetches them. I’m not certain the cache layer exposes selective invalidation so this may not be doable without some work. Potentially a tile that’s currently loaded won’t re-fetch until it unloads and comes back into view, so you wouldn’t see the change right away.
Add native support for refetching a specific loaded tile. This is the “proper” version of what you’re after, and the trickiest. To avoid a flicker you’d want to load the new content alongside the old and swap once it’s ready, rather than unloading first. If this is something you’d want to build, a PR would be very welcome (here’s the contributor guide), and the team gives design feedback during review. Either way, opening a feature request is worth doing to get the use case on record.
One more angle, depending on how often your data changes: if updates are fairly rare, it might be perfectly fine UX to show a small “newer data available, reload?” prompt and do a full tileset refresh on confirm. Then the brief disappear-and-reload is expected rather than jarring.