Module-wide configuration for Storage, applied to both scene-scoped and player-scoped storage via Storage.configure().

Hierarchy

  • StorageOptions

Properties

cacheMaxAgeMs?: number

Max age of a cache entry in milliseconds, bounding both read-cache staleness and write-dedup trust; older entries are treated as unknown. The default is deliberately short so out-of-band writers (CLI storage commands, dashboards) become visible within a minute, while still absorbing hot per-frame reads. Default: 60000 (1 minute).

cacheMaxEntries?: number

Max cache entries per scope (scene / player) before oldest entries are evicted. Entries hold the serialized value body, so memory scales with value size — this bounds entry count, not bytes. Default: 512.

cacheReads?: boolean

When true, get() serves values from the local cache within cacheMaxAgeMs, including confirmed "not found" results, without a network request. Out-of-band writers (e.g. CLI storage commands) may not be visible for up to cacheMaxAgeMs; pass { fresh: true } per call to force a network read. Default: true.

skipIfUnchanged?: boolean

Default for set()'s skipIfUnchanged when not passed per call. A skip only suppresses a proven no-op: the exact serialized value was confirmed stored by a previous network round-trip within cacheMaxAgeMs. Default: true.