Skip to content

Commit bda5b8c

Browse files
authored
Fixes pages cache revalidation behavior for pages router (#132)
* Ensure cache handler is used in dev mode * Fixes pages cache revalidation behavior for pages router * Package bumps
1 parent 98e62b3 commit bda5b8c

File tree

8 files changed

+115
-118
lines changed

8 files changed

+115
-118
lines changed

examples/redis-minimal/cache-handler.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,6 @@ CacheHandler.onCreation(() => {
9797
}
9898
}
9999

100-
if (process.env.NODE_ENV === "development") {
101-
const config = { handlers: [createLruHandler()] };
102-
if (isSingleConnectionModeEnabled) {
103-
global.cacheHandlerConfig = config;
104-
}
105-
return config;
106-
}
107-
108100
const promise = createCacheConfig();
109101
if (isSingleConnectionModeEnabled) {
110102
global.cacheHandlerConfigPromise = promise;

examples/redis-minimal/next.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
cacheHandler:
5-
process.env.NODE_ENV === "production"
6-
? require.resolve("./cache-handler.mjs")
7-
: undefined,
4+
cacheHandler: require.resolve("./cache-handler.mjs"),
85
cacheMaxMemorySize: 0, // disable default in-memory caching
96
experimental: {
107
//ppr: "incremental",

examples/redis-minimal/package-lock.json

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/redis-minimal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"lint": "next lint"
1414
},
1515
"dependencies": {
16-
"@fortedigital/nextjs-cache-handler": "^2.1.1",
16+
"@fortedigital/nextjs-cache-handler": "^2.1.6",
1717
"next": "^15.5.6",
1818
"react": "^19.2.0",
1919
"react-dom": "^19.2.0",
20-
"redis": "^5.8.3"
20+
"redis": "^5.9.0"
2121
},
2222
"devDependencies": {
2323
"@eslint/eslintrc": "^3",

0 commit comments

Comments
 (0)