FluidCache Class
A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
This API is provided for existing users, but is not recommended for new users.
To use, import via @fluidframework/driver-web-cache/legacy.
For more information about our API support guarantees, see here.
Signature
export declare class FluidCache implements IPersistedCache
Implements: IPersistedCache
Constructors
| Constructor | Alerts | Description |
|---|---|---|
| (constructor)(config) | Beta | Constructs a new instance of the FluidCache class |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| get(cacheEntry) | Beta | Promise<any> | |
| put(entry, value) | Beta | Promise<void> | |
| removeEntries(file) | Beta | Promise<void> | |
| removeEntry(entry) | Beta | Promise<void> | |
| update(entry, updater) | Beta | Promise<boolean> | Atomically reads the existing cached entry, hands it to updater, and writes a new value iff updater calls the supplied set callback. The read and the conditional write happen inside a single IndexedDB readwrite transaction, so the decision sees a consistent view across consumers sharing the same underlying IndexedDB instance (for example, multiple browser tabs racing to persist pending state). |
Constructor Details
(constructor)
Constructs a new instance of the FluidCache class
This API is provided for existing users, but is not recommended for new users.
For more information about our API support guarantees, see here.
Signature
constructor(config: FluidCacheConfig);
Parameters
| Parameter | Type | Description |
|---|---|---|
| config | FluidCacheConfig |
Method Details
get
This API is provided for existing users, but is not recommended for new users.
For more information about our API support guarantees, see here.
Signature
get(cacheEntry: ICacheEntry): Promise<any>;