Created
May 12, 2023 10:01
-
-
Save paulwellnerbou/63aa9e9e101625e1c048b4b2b799a4ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { caching } from 'cache-manager'; | |
import { redisStore } from 'cache-manager-redis-yet'; | |
async function createRedisCache(redisHost, ttl) { | |
const redisConfig = { url: `redis://${redisHost}`, db: 0, ttl }; | |
const redisCacheStore = await redisStore(redisConfig); | |
return caching(redisCacheStore); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment