CacheEntry
Represents a cached item retrieved via CoreCache.lookup or as part of a TransactionCacheEntry.insertAndStreamBack operation.
Methods
body
View sourceRetrieves the cached item as a ReadableStream.
Only one stream can be active at a time for a given CacheEntry. An error will be thrown if a stream is already active for this CacheEntry.
Parameters
- options: CacheBodyOptionsoptional
Optional property used to request a range of bytes within the cached item.
Returns
hits
View sourcehits(): numberDetermines the number of cache hits to this cached item.
Note: this hit count only reflects the view of the server that supplied the cached item. Due to clustering, this count may vary between potentially many servers within the data center where the item is cached. See the clustering documentation for details, though note that the exact caching architecture of Compute is different from VCL services.
Returns
length
View sourcelength(): number | nullThe size in bytes of the cached item, if known.
Returns
The length in bytes, or null if the length is currently unknown. The length may be unknown if the item is currently being streamed into the cache without a fixed length.
maxAge
View sourcemaxAge(): numberThe time in milliseconds for which the cached item is considered fresh.
Returns
staleWhileRevalidate
View sourcestaleWhileRevalidate(): numberThe time in milliseconds for which a cached item can safely be used despite being considered stale.
Returns
state
View sourceReturns a CacheState instance which reflects the current state of this CacheEntry instance.
Returns