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

Method Return Type Description
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

Parameter Type Description
entry ICacheEntry cache 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

Parameter Type Description
entry ICacheEntry cache entry.
value any JSON-serializable content.

Returns

Return type: Promise<void>

removeEntries

Removes the entries from the cache for given parametres.

Signature

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

Parameters

Parameter Type Description
file IFileEntry file entry to be deleted.

Returns

Return type: Promise<void>