Brief Description of the Bug
Please forgive me if I'm missing something obvious, but I cannot confirm that this package to persist my cached static site pages or any other data into Redis by following the introduction documentation.
It seems like when I follow the introduction documentation and add the debug env var, I can see the debug logs but after I visit the home page or a static page like the 404 site, I cannot see any cached next.js data in my Redis instance.
Severity
[Critical]
Frequency of Occurrence
[Always]
Steps to Reproduce
Provide detailed steps to reproduce the behavior, including any specific conditions or configurations where the bug occurs:
Follow the introduction documentation here https://caching-tools.github.io/next-shared-cache/installation
-
Have a local Redis instance running
-
Create a new Next.js v14 app with the command npx create-next-app@next-14
- Saw no to app router, use the page router
- Say no to tailwind
- See screenshot

-
Install the package with npm i @neshca/cache-handler
-
Install node-redis 4 with the command npm i redis@maintenance-v4
-
Create a .env file and paste NEXT_PRIVATE_DEBUG_CACHE=1. Following the example here: https://caching-tools.github.io/next-shared-cache/troubleshooting#method-2-debug-mode
-
Create a cache-handler.mjs file. Based on this redis integration example page: https://caching-tools.github.io/next-shared-cache/redis
-
Rename the the next.config.mjs file to next.config.js and update the next.config.js file to include the cache handler
/** @type {import('next').NextConfig} */
module.exports = {
cacheHandler: require.resolve("./cache-handler.mjs"),
experimental: {
instrumentationHook: true,
},
};
- Follow the "populate the Cache with Prerendered Pages" step by creating an instrumentation.ts file and adding the following:
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
const { registerInitialCache } = await import(
"@neshca/cache-handler/instrumentation"
);
// Assuming that your CacheHandler configuration is in the root of the project and the instrumentation is in the src directory.
// Please adjust the path accordingly.
// CommonJS CacheHandler configuration is also supported.
const CacheHandler = (await import("./cache-handler.mjs")).default;
await registerInitialCache(CacheHandler);
}
}
- Build and run the app with
npm run build && npm run start
- Visit localhost:3000 and then visit localhost:3000/notfound
- Observe that the debug logs
using custom cache handler @neshca/cache-handler is not configured yet
[CacheHandler] Instance created with provided context.
But no cached page data can be found in Redis. I'm running keys * in Redis to confirm this.
Expected vs. Actual Behavior
Expected: To be able to see data in Redis after visiting the home page and a static page like the 404 page and seeing a key pre-pended with 'prefix:*' in Redis.
Screenshots/Logs


Environment:
- OS: MacOS
- Node.js version: v20.18.2
@neshca/cache-handler version: 1.9.0
next version: 14.2.29
Dependencies and Versions
"redis": "^4.7.1"
Impact of the Bug
I'm not able to confirm if I have this package working with my app.
Additional context
Hope that helps! I want to be able to use this package because I want a simple way to centrally store my SSG pages in Redis.
Brief Description of the Bug
Please forgive me if I'm missing something obvious, but I cannot confirm that this package to persist my cached static site pages or any other data into Redis by following the introduction documentation.
It seems like when I follow the introduction documentation and add the debug env var, I can see the debug logs but after I visit the home page or a static page like the 404 site, I cannot see any cached next.js data in my Redis instance.
Severity
[Critical]
Frequency of Occurrence
[Always]
Steps to Reproduce
Provide detailed steps to reproduce the behavior, including any specific conditions or configurations where the bug occurs:
Follow the introduction documentation here https://caching-tools.github.io/next-shared-cache/installation
Have a local Redis instance running
Create a new Next.js v14 app with the command
npx create-next-app@next-14Install the package with
npm i @neshca/cache-handlerInstall node-redis 4 with the command
npm i redis@maintenance-v4Create a
.envfile and pasteNEXT_PRIVATE_DEBUG_CACHE=1. Following the example here: https://caching-tools.github.io/next-shared-cache/troubleshooting#method-2-debug-modeCreate a
cache-handler.mjsfile. Based on this redis integration example page: https://caching-tools.github.io/next-shared-cache/redisRename the the
next.config.mjsfile tonext.config.jsand update thenext.config.jsfile to include the cache handlernpm run build && npm run startBut no cached page data can be found in Redis. I'm running
keys *in Redis to confirm this.Expected vs. Actual Behavior
Expected: To be able to see data in Redis after visiting the home page and a static page like the 404 page and seeing a key pre-pended with 'prefix:*' in Redis.
Screenshots/Logs
Environment:
@neshca/cache-handlerversion: 1.9.0nextversion: 14.2.29Dependencies and Versions
"redis": "^4.7.1"
Impact of the Bug
I'm not able to confirm if I have this package working with my app.
Additional context
Hope that helps! I want to be able to use this package because I want a simple way to centrally store my SSG pages in Redis.