Skip to main content
Version: v1

IPersistedCache Interface

Persistent cache. This interface can be implemented by the host to provide durable caching across sessions. If not provided at driver factory construction, factory will use in-memory cache implementation that does not survive across sessions. Snapshot entires stored in the IPersistedCache will be considered stale and removed after 2 days. Read the README for more information.

Signature

export interface IPersistedCache

Methods

MethodReturn TypeDescription
get(entry)Promise<any>Get the cache value of the key
put(entry, value)Promise<void>Put the value into cache. Important - only serializable content is allowed since this cache may be persisted between sessions
removeEntries(file)Promise<void>Removes the entries from the cache for given parametres.

Method Details

get

Get the cache value of the key

Signature

get(entry: ICacheEntry): Promise<any>;

Parameters

ParameterTypeDescription
entryICacheEntrycache entry, identifies file and particular key for this file.

Returns

Cached value. undefined if nothing is cached.

Return type: Promise<any>

put

Put the value into cache. Important - only serializable content is allowed since this cache may be persisted between sessions

Signature

put(entry: ICacheEntry, value: any): Promise<void>;

Parameters

ParameterTypeDescription
entryICacheEntrycache entry.
valueanyJSON-serializable content.

Returns

Return type: Promise<void>

removeEntries

Removes the entries from the cache for given parametres.

Signature

removeEntries(file: IFileEntry): Promise<void>;

Parameters

ParameterTypeDescription
fileIFileEntryfile entry to be deleted.

Returns

Return type: Promise<void>