koa-api-starter icon indicating copy to clipboard operation
koa-api-starter copied to clipboard

Redis and RedisCache clients

Open vladimirmyshkovski opened this issue 3 years ago • 1 comments

  • Add redis-client.js module
  • Replace client to imported redis-client in ioEmitter.js
  • Create cache module with RedisCacheClient .
  • Replace redis to ioredis in dependencies.

Now we can use it like that:

const redisCacheClient = require('cache');
const cache = redisCacheClient.child('products');
const name = `key`;
await cache.exists(name);
await cache.get(name);
await cache.set(name, html);
await cache.remove(name);
await cache.removeAll();

vladimirmyshkovski avatar Dec 09 '20 20:12 vladimirmyshkovski

Guys, interesting your opinion about this improvement.

vladimirmyshkovski avatar Sep 23 '21 21:09 vladimirmyshkovski