Releases: fortedigital/nextjs-cache-handler
Releases · fortedigital/nextjs-cache-handler
2.1.0-canary.12
Full Changelog: 2.1.0-canary.11...2.1.0-canary.12
2.1.0-canary.11
What's Changed
- Support Redis Cluster connection by @AyronK in #47
- Fixes fetch cache writing to file system allowing instrumentation to prepopulate it. by @AyronK in #65
Full Changelog: 2.0.3...2.1.0-canary.11
2.1.0-canary9
Full Changelog: 2.1.0-canary1...2.1.0-canary9
2.1.0-canary10
import { createCluster } from "@redis/client";
import createRedisHandler from "@fortedigital/nextjs-cache-handler/redis-strings";
import { withAdapter } from "@fortedigital/nextjs-cache-handler/cluster/adapter";
const { hostname: redisHostName } = new URL(process.env.REDIS_URL);
redis = withAdapter(
  createCluster({
    rootNodes: [{ url: process.env.REDIS_URL }],
    // optional if you use TLS and need to resolve shards' ip to proper hostname
    nodeAddressMap(address) {
      const [_, port] = address.split(":");
      return {
        host: redisHostName,
        port: Number(port),
      };
    },
  })
);
// after using withAdapter you can use redis cluster instance as parameter for createRedisHandler
const redisCacheHandler = createRedisHandler({
  client: redis,
  keyPrefix: CACHE_PREFIX,
});Full Changelog: 2.1.0-canary9...2.1.0-canary10
2.1.0-canary8
Full Changelog: 2.1.0-canary7...2.1.0-canary8
2.1.0-canary7
Full Changelog: 2.1.0-canary6...2.1.0-canary7
2.1.0-canary6
Full Changelog: 2.1.0-canary5...2.1.0-canary6
2.1.0-canary5
Full Changelog: 2.1.0-canary4...2.1.0-canary5
2.1.0-canary4
Full Changelog: 2.1.0-canary3...2.1.0-canary4
2.1.0-canary3
Full Changelog: 2.1.0-canary2...2.1.0-canary3