CacheState

Classin cache@fastly/js-compute 3.46.0since 3.9.0View source

The status of this lookup (and potential transaction).

Methods

found(): boolean

Returns true if a cached item was located.

Even if a cached item is found, the cached item might be stale and require updating. Use mustInsertOrUpdate() to determine whether this transaction client is expected to update the cached item.

Returns

boolean

mustInsertOrUpdate

View source
mustInsertOrUpdate(): boolean

Returns true if a fresh cache item was not found, and this transaction client is expected to insert a new item or update a stale item.

Returns

boolean
stale(): boolean

Returns true if the cached item is stale.

A cached item is stale if its age is greater than its maxAge period.

Returns

boolean
usable(): boolean

Returns true if the cached item is usable.

A cached item is usable if its age is less than the sum of the maxAge and staleWhileRevalidate periods.

Returns

boolean