Skip to content

Reset Cache APIs

Get redis key/keys

Get redis keys

Get redis key using global object 'g'.

  • Get single redis key value.
await g.sys.cache.getKey("REDIS_KEY_NAME");
  • Get multiple redis keys values.
await g.sys.cache.getKey(["REDIS_KEY_NAME", "ANOTHER_REDIS_KEY_NAME"]);

Set redis key/keys

Set redis keys

Set redis key using global object 'g'.

await g.sys.cache.setKey([
    {
        key: "redis_key_name",
        value: "redis_key_value",
        ttl: 1500  // This key will be available till next 1500 seconds.
    },
    {
        key: "redis_key_name",
        value: "redis_key_value"
    }
]);

Remove redis key/keys

Remove redis keys

Remove redis key and its value using global object 'g'.

await g.sys.cache.removeKey("REDIS_KEY_NAME");

Remove multiple redis keys.

await g.sys.cache.removeKey(["REDIS_KEY_NAME", "ANOTHER_REDIS_KEY_NAME"]);

Reset cache of custom APIs

Reset cache custom API

Reset cache of the custom API using global object 'g'.

await g.sys.cache.resetCacheCustomApis("CUSTOM_API_NAME");

Reset cache of system APIs

Reset cache of system API

Reset cache of system API using global object 'g'.

await g.sys.cache.resetCacheSystemApis("SYSTEM_API_NAME");

Reset cache of third party APIs

Reset cache of Third party APIs

Reset Third party API cache using global object 'g'.

1
2
3
4
await g.sys.cache.resetCacheThirdPartyApis({
    "apiBundleName": "bundle_name",
    "apiVersionName": "api_version_name"
});

Reset cache of database table/collection

Database cache reset

Reset cache of database table/collection using global object 'g'.

1
2
3
4
5
await g.sys.cache.resetCacheDB({
    instance: "INSTANCE_NAME",
    database: "DATABASE_NAME",
    collection: "COLLECTION_NAME"
});