Skip to content

Nextjs k8s with a Redis deployement local - help #463

Answered by erwanriou
erwanriou asked this question in Q&A
Discussion options

You must be logged in to vote

Ok i made it work.. and the solution was to use the .default for a js file...

const { CacheHandler } = require("@neshca/cache-handler")
const createRedisHandler = require("@neshca/cache-handler/redis-stack").default
const createLruHandler = require("@neshca/cache-handler/local-lru").default
const { createClient } = require("redis")

CacheHandler.onCreation(async () => {
  const client = await createClient({ url: process.env.REDIS_URL })
    .on("error", error => console.error("Redis error:", error?.message))
    .connect()

  const redisHandler = await createRedisHandler({ client, keyPrefix: process.env.NEXT_PUBLIC_HOSTNAME, timeoutMs: 5000 })
  const localHandler = createLruHandler()
  r…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by erwanriou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant