@trieb.work/nextjs-turbo-redis-cache 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +11 -2
- package/CHANGELOG.md +14 -0
- package/README.md +4 -1
- package/dist/index.js +20 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/RedisStringsHandler.ts +26 -15
- package/test/README.md +3 -3
- package/test/nextjs-test-projects/next-app-15-4-11/pnpm-lock.yaml +1 -1
- package/test/nextjs-test-projects/next-app-16-0-11/pnpm-lock.yaml +1 -1
- package/test/nextjs-test-projects/next-app-16-0-11-cache-components/pnpm-lock.yaml +1 -1
- package/test/nextjs-test-projects/next-app-16-2-6/pnpm-lock.yaml +1 -1
- package/test/nextjs-test-projects/next-app-16-2-6-cache-components/pnpm-lock.yaml +1 -1
- package/test/nextjs-test-projects/next-app-16-3-0/README.md +36 -0
- package/test/nextjs-test-projects/next-app-16-3-0/eslint.config.mjs +18 -0
- package/test/nextjs-test-projects/next-app-16-3-0/next.config.ts +7 -0
- package/test/nextjs-test-projects/next-app-16-3-0/package.json +28 -0
- package/test/nextjs-test-projects/next-app-16-3-0/pnpm-lock.yaml +4284 -0
- package/test/nextjs-test-projects/next-app-16-3-0/postcss.config.mjs +7 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/cached-static-fetch/route.ts +18 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/nested-fetch-in-api-route/revalidated-fetch/route.ts +27 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/revalidatePath/route.ts +15 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/revalidateTag/route.ts +20 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/revalidated-fetch/route.ts +17 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/api/uncached-fetch/route.ts +15 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/favicon.ico +0 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/globals.css +26 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/layout.tsx +59 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/page.tsx +755 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/cached-static-fetch/default--force-dynamic-page/page.tsx +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/cached-static-fetch/revalidate15--default-page/page.tsx +34 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/cached-static-fetch/revalidate15--force-dynamic-page/page.tsx +25 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/no-fetch/default-page/page.tsx +55 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/revalidated-fetch/default--force-dynamic-page/page.tsx +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/revalidated-fetch/revalidate15--default-page/page.tsx +35 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/revalidated-fetch/revalidate15--force-dynamic-page/page.tsx +25 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/uncached-fetch/default--force-dynamic-page/page.tsx +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/uncached-fetch/revalidate15--default-page/page.tsx +32 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/pages/uncached-fetch/revalidate15--force-dynamic-page/page.tsx +25 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/revalidation-interface.tsx +267 -0
- package/test/nextjs-test-projects/next-app-16-3-0/src/app/update-tag-test/page.tsx +25 -0
- package/test/nextjs-test-projects/next-app-16-3-0/tsconfig.json +34 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/README.md +36 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/cache-handler.js +3 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/eslint.config.mjs +18 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/next.config.ts +13 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/package.json +28 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/pnpm-lock.yaml +4284 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/postcss.config.mjs +7 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/public/file.svg +1 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/public/globe.svg +1 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/public/next.svg +1 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/public/vercel.svg +1 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/public/window.svg +1 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/api/cached-static-fetch/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/api/cached-with-cachelife/route.ts +24 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/api/cached-with-tag/route.ts +21 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/api/revalidate-tag/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/api/revalidated-fetch/route.ts +19 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/cachelife-short/page.tsx +110 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/page.tsx +90 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/runtime-data-suspense/page.tsx +127 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/stale-while-revalidate/page.tsx +130 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/tag-invalidation/page.tsx +127 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/cache-lab/use-cache-nondeterministic/page.tsx +110 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/favicon.ico +0 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/globals.css +26 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/layout.tsx +57 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/page.tsx +755 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/revalidation-interface.tsx +267 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/src/app/update-tag-test/page.tsx +22 -0
- package/test/nextjs-test-projects/next-app-16-3-0-cache-components/tsconfig.json +34 -0
- package/test/nextjs-test-projects/next-pages-16-2-6/pnpm-lock.yaml +4 -4
- package/test/nextjs-test-projects/next-pages-16-3-0/README.md +16 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/eslint.config.mjs +18 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/next.config.ts +7 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/package.json +26 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/pnpm-lock.yaml +3939 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/src/pages/api/revalidate.ts +24 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/src/pages/index.tsx +11 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/src/pages/isr/[slug].tsx +49 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/src/pages/static-forever.tsx +20 -0
- package/test/nextjs-test-projects/next-pages-16-3-0/tsconfig.json +34 -0
- package/test/vitest/integration/nextjs-cache-handler.integration.test.ts +51 -32
- package/test/vitest/unit/index.test.ts +28 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -65,6 +65,7 @@ jobs:
|
|
|
65
65
|
- next-app-15-4-11
|
|
66
66
|
- next-app-16-0-11
|
|
67
67
|
- next-app-16-2-6
|
|
68
|
+
- next-app-16-3-0
|
|
68
69
|
steps:
|
|
69
70
|
- name: Checkout code
|
|
70
71
|
uses: actions/checkout@v6
|
|
@@ -111,6 +112,11 @@ jobs:
|
|
|
111
112
|
integration-pages:
|
|
112
113
|
runs-on: ubuntu-latest
|
|
113
114
|
needs: lint-and-unit
|
|
115
|
+
strategy:
|
|
116
|
+
matrix:
|
|
117
|
+
pages-test-app:
|
|
118
|
+
- next-pages-16-2-6
|
|
119
|
+
- next-pages-16-3-0
|
|
114
120
|
steps:
|
|
115
121
|
- name: Checkout code
|
|
116
122
|
uses: actions/checkout@v6
|
|
@@ -143,15 +149,16 @@ jobs:
|
|
|
143
149
|
run: redis-cli config set notify-keyspace-events Exe
|
|
144
150
|
|
|
145
151
|
- name: Install test project
|
|
146
|
-
run: cd test/nextjs-test-projects
|
|
152
|
+
run: cd test/nextjs-test-projects/${{ matrix.pages-test-app }} && pnpm install
|
|
147
153
|
|
|
148
154
|
- name: Build test project
|
|
149
|
-
run: cd test/nextjs-test-projects
|
|
155
|
+
run: cd test/nextjs-test-projects/${{ matrix.pages-test-app }} && pnpm build
|
|
150
156
|
|
|
151
157
|
- name: Run Pages Router integration tests
|
|
152
158
|
run: pnpm test:integration:pages
|
|
153
159
|
env:
|
|
154
160
|
SKIP_BUILD: true
|
|
161
|
+
NEXT_PAGES_TEST_APP: ${{ matrix.pages-test-app }}
|
|
155
162
|
|
|
156
163
|
integration-build-id-prefix:
|
|
157
164
|
runs-on: ubuntu-latest
|
|
@@ -204,6 +211,7 @@ jobs:
|
|
|
204
211
|
cache-components-app:
|
|
205
212
|
- next-app-16-0-11-cache-components
|
|
206
213
|
- next-app-16-2-6-cache-components
|
|
214
|
+
- next-app-16-3-0-cache-components
|
|
207
215
|
steps:
|
|
208
216
|
- name: Checkout code
|
|
209
217
|
uses: actions/checkout@v6
|
|
@@ -254,6 +262,7 @@ jobs:
|
|
|
254
262
|
cache-components-app:
|
|
255
263
|
- next-app-16-0-11-cache-components
|
|
256
264
|
- next-app-16-2-6-cache-components
|
|
265
|
+
- next-app-16-3-0-cache-components
|
|
257
266
|
steps:
|
|
258
267
|
- name: Checkout code
|
|
259
268
|
uses: actions/checkout@v6
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.17.0](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.16.2...v1.17.0) (2026-08-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add Next.js 16.3.0 support ([f7b40b5](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/f7b40b54e76cb605b8986f2bd01477662d94bd06))
|
|
7
|
+
|
|
8
|
+
## [1.16.2](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.16.1...v1.16.2) (2026-08-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* clear the readiness-timeout timer leaked on every cache operation ([#90](https://github.com/trieb-work/nextjs-turbo-redis-cache/issues/90)) ([ab542e3](https://github.com/trieb-work/nextjs-turbo-redis-cache/commit/ab542e3e83bef53c863d7affa916adb9de8ad935))
|
|
14
|
+
|
|
1
15
|
## [1.16.1](https://github.com/trieb-work/nextjs-turbo-redis-cache/compare/v1.16.0...v1.16.1) (2026-08-13)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# nextjs-turbo-redis-cache - Next.js Cache Handler
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@trieb.work/nextjs-turbo-redis-cache)
|
|
4
|
-
|
|
4
|
+
<img width="2512" height="1602" alt="Turbo redis cache image" src="https://github.com/user-attachments/assets/6f46e1fb-fcf7-4157-856c-196a1483534f" />
|
|
5
5
|
|
|
6
6
|
The ultimate Redis Cache Handler for Next.js 15 / 16, supporting both the App Router and the Pages Router. Built for production-ready, large-scale projects, it delivers unparalleled performance and efficiency with features tailored for high-traffic applications. This package has been created after extensibly testing the @neshca package and finding several major issues with it.
|
|
7
7
|
|
|
@@ -34,6 +34,9 @@ Tested versions are:
|
|
|
34
34
|
- Nextjs 16.2.6 + redis client 4.7.0 (cacheComponents: false)
|
|
35
35
|
- Nextjs 16.2.6 + redis client 4.7.0 (cacheComponents: true)
|
|
36
36
|
- Nextjs 16.2.6 + redis client 4.7.0 (Pages Router)
|
|
37
|
+
- Nextjs 16.3.0 + redis client 4.7.0 (cacheComponents: false)
|
|
38
|
+
- Nextjs 16.3.0 + redis client 4.7.0 (cacheComponents: true)
|
|
39
|
+
- Nextjs 16.3.0 + redis client 4.7.0 (Pages Router)
|
|
37
40
|
|
|
38
41
|
_Cache Components_ (Next.js 16+) are fully supported. Automated test coverage includes `'use cache'`, `cacheTag`, and `cacheLife` flows in the Cache Components integration suite.
|
|
39
42
|
|
package/dist/index.js
CHANGED
|
@@ -720,21 +720,26 @@ var RedisStringsHandler = class {
|
|
|
720
720
|
"assertClientIsReady called more than 10 times without being ready."
|
|
721
721
|
);
|
|
722
722
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
723
|
+
let readyTimeout;
|
|
724
|
+
try {
|
|
725
|
+
await Promise.race([
|
|
726
|
+
Promise.all([
|
|
727
|
+
this.sharedTagsMap.waitUntilReady(),
|
|
728
|
+
this.revalidatedTagsMap.waitUntilReady()
|
|
729
|
+
]),
|
|
730
|
+
new Promise((_, reject) => {
|
|
731
|
+
readyTimeout = setTimeout(() => {
|
|
732
|
+
reject(
|
|
733
|
+
new Error(
|
|
734
|
+
"assertClientIsReady: Timeout waiting for Redis maps to be ready"
|
|
735
|
+
)
|
|
736
|
+
);
|
|
737
|
+
}, 3e4);
|
|
738
|
+
})
|
|
739
|
+
]);
|
|
740
|
+
} finally {
|
|
741
|
+
clearTimeout(readyTimeout);
|
|
742
|
+
}
|
|
738
743
|
this.clientReadyCalls = 0;
|
|
739
744
|
if (!this.client.isReady) {
|
|
740
745
|
throw new Error(
|