# Example ### Source ```js const cacheManager = require('cache-manager'); const redisStore = require('cache-manager-ioredis'); const Redis = require('ioredis'); const redis = new Redis(); const cache = cacheManager.caching({ store: redisStore, redisInstance: redis, ttl: 123 }); async function test() { await cache.set('foo', 'bar'); console.log(await cache.ttl('foo')); } test().then(process.exit); ``` ### Output (Actual) ``` -1 ``` ### Output (Expected) ``` 123 ```