Skip to Content
🎉 Version 1.9.0 is out! This is the final release supporting Next.js 13.5.1-14.x. The upcoming version 2.0.0 will require Next.js 15.
Usage guidesDevelopment Environment

Using @neshca/cache-handler in development environment

Since the primary purpose of @neshca/cache-handler is to accommodate the sharing of the cache between multiple and independent replicas of the Next.js application, there is no need to use it in a development environment.

The easiest way to turn off the cache handler in a development environment is to use process.env.NODE_ENV:

next.config.js
const nextConfig = { cacheHandler: process.env.NODE_ENV === 'production' ? require.resolve('./cache-handler.mjs') : undefined, // Use `experimental` option instead of the `cacheHandler` property when using Next.js versions from 13.5.1 to 14.0.4 /* experimental: { incrementalCacheHandlerPath: process.env.NODE_ENV === 'production' ? require.resolve('./cache-handler.mjs') : undefined, }, */ };
Last updated on