Something went wrong. Try again.
[READ-ONLY]
a fast, modern browser for the npm registry forked from npmx.dev/npmx.dev
Something went wrong. Try again.
123456789101112131415import { Redis } from '@upstash/redis'
export function getCacheAdapter(prefix: string): CacheAdapter { const config = useRuntimeConfig()
if (!import.meta.dev && config.upstash?.redisRestUrl && config.upstash?.redisRestToken) { const redis = new Redis({ url: config.upstash.redisRestUrl, token: config.upstash.redisRestToken, }) return new RedisCacheAdapter(redis, prefix) } return new LocalCacheAdapter()}