voxolith

SceneCacheOptions

Options for the scene cache (openSceneCache, serveScene({ cache })).

Defined in: engine/src/worker/scene-cache.ts:78

Extended by

Properties

PropertyTypeDescriptionDefined in
compress?booleanDeflate what is stored (default false). Measured on nightwood at 100 vox/m (desktop Chrome): its twelve encodings and one bake are 528 MB as they are and about 6-7 times smaller deflated, but deflating them takes about 14 s of the worker's time after a first visit (35-90 MB/s, and only while the worker is not baking), and inflating adds about 0.8 s to every warm visit, where reading them as they are takes about 0.2 s. So it is for storage that is tight (and then give makeSceneWorker a longer closeTimeoutMs, or the writes of a short visit are lost), not for speed.engine/src/worker/scene-cache.ts:100
maxBytes?numberKeep the cache under about this many bytes (as stored): after each write the least recently used entries are evicted until it fits, and a result bigger than the cap is not kept at all. Unset, it grows until the browser's quota stops it (a failed write keeps nothing). Size it by measuring, as for the model cache: load the heaviest scenes with no cap, read SceneCacheControls.usage, and add headroom (the examples measured 108-693 MB at 50-100 voxels per metre). Checked and warned about as ModelCacheOptions.maxBytes describes: a value that is not a positive finite number throws; under 16 MiB, above the origin's quota, or smaller than an entry warns once per cache.engine/src/worker/scene-cache.ts:90

On this page