datasource.cacheExists
Checks whether a key is in the server-wide in-memory cache.
js
datasource.cacheExists(key)Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key. |
Returns
booleantrue when the key is in the cache. false when it was never set or has expired.
Examples
js
if (!datasource.cacheExists("dailyRate")) {
datasource.cacheSet("dailyRate", "1.52", 3600000);
}