Skip to content

alexdln/nimpl-cache

Repository files navigation

nimpl-cache

Repository for implementing caching solutions in Next.js. This monorepo contains cache handlers and utilities designed to provide efficient, scalable caching for Next.js applications.

@nimpl/cache-redis

@nimpl/cache-redis Redis-based cache handler with multi-pod support. Implements a two-tier caching strategy: an in-memory LRU cache for fast local access and Redis for shared cache across multiple pods. This architecture enables efficient cache sharing in Kubernetes deployments where multiple instances need to share cached data.

Read more about @nimpl/cache-redis

Installation

npm install @nimpl/cache-redis
# or
pnpm add @nimpl/cache-redis

Quick Start

Configure the cache handler in your next.config.ts:

import { type NextConfig } from "next/types";

const nextConfig: NextConfig = {
  cacheComponents: true,
  cacheHandlers: {
    default: import.meta.resolve("@nimpl/cache-redis"),
  },
};

export default nextConfig;

Set the Redis connection URL:

REDIS_URL=redis://localhost:6379

@nimpl/cache-widget

@nimpl/cache-widget is a React widget for visualizing and inspecting cache entries from @nimpl/cache-redis. It provides a user-friendly interface to view cache keys, their details, and metadata in your application.

Read more about @nimpl/cache-widget

@nimpl/cache-tools

@nimpl/cache-tools provides utilities for working with @nimpl/cache-like cache handlers, including data retrieval and function caching. It offers helpers for creating cached functions and API routes for cache inspection tools like @nimpl/cache-widget.

Read more about @nimpl/cache-tools

Legacy Packages

Note: The following packages are outdated and not actively maintained for now. They will be updated and improved soon:

  • @nimpl/cache-adapter - Legacy cache adapter package
  • @nimpl/cache-in-memory - Legacy in-memory cache handler

For new projects, use @nimpl/cache-redis instead.

License

MIT

About

Repository for implementing caching solutions for full-stack frameworks (incl. next.js cacheHandlers)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published