Skip to content

Instantly share code, notes, and snippets.

@paulwellnerbou
Created May 12, 2023 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulwellnerbou/63aa9e9e101625e1c048b4b2b799a4ed to your computer and use it in GitHub Desktop.
Save paulwellnerbou/63aa9e9e101625e1c048b4b2b799a4ed to your computer and use it in GitHub Desktop.
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