API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classCacheFirstStrategy

@codexo/exojs / resources / stable

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.

0
props
1
methods
0
events
Import
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.

Constructors 1
new(): CacheFirstStrategy
Methods 1
resolve(request: CacheRequest, stores: readonly CacheStore[]): Promise<unknown>
Source