API reference

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

C

classCacheFirstPolicy

@codexo/exojs / assets / stable

Reads the cache first and only fetches when it misses. The default policy, and the right one for content that does not change behind a stable URL. A cache failure never fails a load that the network could still serve: a read failure is degraded into a miss, and a write failure is degraded into "not cached this time". Both are reported to Loader.onCacheError before they are degraded, so a store that is silently refusing every write stays diagnosable. A missing entry and a failing store therefore behave the same way HERE, and differently everywhere it matters - see CacheOnlyPolicy, which has no network leg to degrade onto.

0
props
1
methods
0
events
Import
import { CacheFirstPolicy } from '@codexo/exojs'

Reads the cache first and only fetches when it misses.

The default policy, and the right one for content that does not change behind a stable URL. A cache failure never fails a load that the network could still serve: a read failure is degraded into a miss, and a write failure is degraded into "not cached this time". Both are reported to Loader.onCacheError before they are degraded, so a store that is silently refusing every write stays diagnosable.

A missing entry and a failing store therefore behave the same way HERE, and differently everywhere it matters - see CacheOnlyPolicy, which has no network leg to degrade onto.

Constructors1
new(): CacheFirstPolicy
Methods1
Source