ModelCacheOptions
Options for openModelCache.
Defined in: engine/src/worker/cache.ts:57
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
maxBytes? | number | Keep the cache under about this many bytes (compressed): after each write, the least recently used entries (of any salt) are evicted until it fits, and a model bigger than the cap is not kept at all. Unset, the cache grows until the browser's quota stops it (a failed write keeps nothing, the model still works). The cap is the game's to set: size it by measuring. Load the game's heaviest scenes once with no cap, read ModelCacheControls.usage (e.g. from the console), and set the cap to that with some headroom, so that what one play session needs stays cached. Checked when the cache is made: a value that is not a positive finite number throws (a RangeError). These warn once per cache, with console.warn (each worker keeps its own cache, so a pool of four may warn four times): a cap under CACHE_CAP_FLOOR (16 MiB); a cap above the origin's quota as navigator.storage.estimate() reports it (the browser evicts first, so the cap never applies); and the first entry bigger than the cap, which is then not kept. | engine/src/worker/cache.ts:75 |
ModelCacheFilter
Which entries a control applies to; every field given must match. An empty filter matches everything.
PackedEntity
An entity as one header plus one byte buffer holding its arrays, from packEntity: how the model cache stores entities and how serveGenerators posts them (one buffer to transfer).