openSceneCache()
The scene cache in IndexedDB database name, or null where there is none (bun, some private windows, a database an older build in another tab holds open). Used by serveScene in the worker; entries stored under any other salt are deleted when it opens, so a new build frees the old build's results.
function openSceneCache(
name: string,
salt: string,
opts?: SceneCacheOptions
): Promise<SceneCache | null>;Defined in: engine/src/worker/scene-cache.ts:331
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The database name (the same one given to serveScene({ cache })). |
salt | string | Prefixed to every key; the worker passes its script URL. |
opts? | SceneCacheOptions | A size cap, and compression. |
Returns
Promise<SceneCache | null>
openModelCacheOn()
openModelCache on a store of your own: deletes the entries of every other salt, then returns makeModelCache on it.
openSceneCacheControls()
Open controls for the scene cache in IndexedDB database name (the name given to serveScene({ cache })), or null where there is no IndexedDB. Works from the main thread while the worker uses the cache. As with openModelCacheControls, nothing is cleared or trimmed unless the app asks (apart from...