API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classCacheFirstStrategy
CacheStrategy that checks every provided CacheStore before falling back to the network. On a cache hit the stored value is fed directly to factory.create; if that throws (stale or corrupt entry) the entry is deleted and the next store is tried. Only once all stores miss does the strategy fetch from the network and write the processed source back to every store. Quota or serialisation errors during write are swallowed silently so that a full storage can never prevent an asset from loading. Returns the fully constructed resource — callers do not need to call AssetFactory.create again.
import { CacheFirstStrategy } from '@codexo/exojs' CacheStrategy that checks every provided CacheStore before falling back to the network.
On a cache hit the stored value is fed directly to factory.create; if that throws (stale or corrupt entry) the entry is deleted and the next store is tried. Only once all stores miss does the strategy fetch from the network and write the processed source back to every store. Quota or serialisation errors during write are swallowed silently so that a full storage can never prevent an asset from loading.
Returns the fully constructed resource — callers do not need to call AssetFactory.create again.
new(): CacheFirstStrategy resolve(request: CacheRequest, stores: readonly CacheStore[]): Promise<unknown>