Description
@neshca/cache-handler, from the next-shared-cache repository, is a cache handler for Next.js that lets several app instances share one cache. It targets self-hosted deployments where the app runs as multiple independent instances, and it is built to work with Redis or custom cache strategies. It offers a simple API with pre-configured handlers for ISR and data caching. The neshCache function can replace unstable_cache for more control, and neshClassicCache lets the Pages Router cache expensive work in getServerSideProps and API routes. On-demand revalidation applies across every replica, and a TTL setting removes old entries to keep storage tidy. The library can pre-populate the cache with initial data at startup through the instrumentation hook, and it supports both the Pages Router and the App Router with one setup. It requires Next.js 13.5.1 or newer, below 15.0.0, and Node.js 18.17.0 or newer.…
Highlights
- Shared cache across app instances
- Redis and custom cache handlers
- On-demand revalidation for all replicas
- neshCache can replace unstable_cache
- Works with the Pages and App Router
Ratings & Reviews
No ratings yet
Be the first to rate Next Shared Cache.
People also visit

nextjs-cache-architecture
Design or implement caching in a Next.js 16+ App Router project
vercel-labs/next-cache-components
Caching strategies and cache-aware components in Next.js

next.js skills (cache components)
Next.js Cache Components and Partial Prerendering guidance
Next Shared Cache FAQ
What problem does it solve?
Caching across several independent Next.js instances, so self-hosted apps can share ISR and data cache entries.
Which Next.js and Node versions are supported?
Next.js 13.5.1 or newer, below 15.0.0, on Node.js 18.17.0 or newer.
Does it work with Redis?
Yes. The project highlights Redis-backed custom cache strategies, which you build with its handler API.
Does it support the App Router?
Yes. It supports both the Pages Router and the App Router with one setup.
What are the best Next Shared Cache alternatives?
Popular alternatives to Next Shared Cache include Github Actions Cache Server, Cachely and Vinext. See all Next Shared Cache alternatives









