A lightweight Redis caching utility for Payload CMS v3 and Next.js 14+ App Router applications, currently at version 1.0.3. It provides a simple Redis client wrapper, server-only safe, with TypeScript and ESM support. Key differentiators: designed specifically for Payload CMS v3, supports collection caching and cache invalidation hooks, and includes examples for API routes and Next.js client components. The package is actively maintained by a single author and has an MIT license.
npm install payloadcms-redis-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic Redis set and get operations using the exported redis client. Shows TTL option.
Run 'npm install ioredis' if missing.
Only use in server components, API routes, or server actions.
Pin version to avoid breaking changes: 'payloadcms-redis-cache': '1.0.3'
Set .env or process.env values before calling redis methods.
Start Redis server (e.g., 'brew services start redis' on Mac). Verify REDIS_HOST and REDIS_PORT.
Use 'import { redis } from 'payloadcms-redis-cache' instead of 'import redis from ...'Move redis usage to server-only code: API routes, server components, or server actions.