@leejpsd/nextjs-cache-handler 0.1.0-rc.1 → 0.1.1
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/CHANGELOG.md +55 -0
- package/README.md +48 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,61 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.1] - 2026-05-10
|
|
10
|
+
|
|
11
|
+
Documentation-only patch released alongside the first round of external
|
|
12
|
+
write-ups. No code changes.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **Compatibility matrix** now carries an explicit verification date and a
|
|
17
|
+
`nextjs-turbo-redis-cache` column, so readers can spot-check the comparison
|
|
18
|
+
against the upstream READMEs as both packages evolve. The previous
|
|
19
|
+
two-column shape didn't make it obvious which competitors are tracked.
|
|
20
|
+
- **Production checklist** gains an explicit Redis Cluster row: cluster
|
|
21
|
+
deployments must set `hashTag: true` to avoid `CROSSSLOT` errors from
|
|
22
|
+
the multi-key Lua scripts. Also notes that cluster support is
|
|
23
|
+
unit-tested but not yet load-tested at scale.
|
|
24
|
+
- **Compatibility table for Redis-protocol services** (ElastiCache,
|
|
25
|
+
Upstash, DragonflyDB, KeyDB, Vercel KV) added to the production
|
|
26
|
+
section, separating "validated" from "expected to work via the
|
|
27
|
+
standard Redis protocol".
|
|
28
|
+
- **`docs/architecture.md`** now documents two memory-fallback caveats
|
|
29
|
+
that previously required reading the source: per-process isolation
|
|
30
|
+
(cross-instance correctness degrades during Redis outages) and the
|
|
31
|
+
32-bit `setTimeout` clamp (TTLs above ≈24.85 days fire the eviction
|
|
32
|
+
timer early, though `get()`'s lazy `expiresAt` check still honors the
|
|
33
|
+
configured expiration).
|
|
34
|
+
|
|
35
|
+
## [0.1.0] - 2026-05-10
|
|
36
|
+
|
|
37
|
+
First stable release. Promoted from `0.1.0-rc.1` after a 24-hour live-traffic
|
|
38
|
+
soak on AWS ECS Fargate (multi-instance, ElastiCache Redis): 0 errors, 0
|
|
39
|
+
entry leaks, Redis ping stable at 2ms, namespace isolation confirmed in
|
|
40
|
+
runtime cache key shapes.
|
|
41
|
+
|
|
42
|
+
### Verified during dogfood
|
|
43
|
+
|
|
44
|
+
- Library wrapper modules require'd successfully on every staging task
|
|
45
|
+
(CloudWatch `[lib-incremental]` / `[lib-cache-components]` startup
|
|
46
|
+
signals)
|
|
47
|
+
- Cache entries written with `BUILD_NAMESPACE` prefix
|
|
48
|
+
(`next-cache:entry:<sha>:...`) — confirms deployment isolation
|
|
49
|
+
- `revalidateAccepted: 1` round-trip latency 193ms across the ALB; Server
|
|
50
|
+
Action `revalidateTag` propagates without errors
|
|
51
|
+
- Static chunks resolve 200 across both `/dashboard` and `/experiments`
|
|
52
|
+
routes — the static-chunk-404 incident remediation is live
|
|
53
|
+
|
|
54
|
+
### Pre-1.0 caveats
|
|
55
|
+
|
|
56
|
+
- Released under 0.1.x — APIs may receive small adjustments before 1.0
|
|
57
|
+
- Single-flight refresh lock is bundled (`refresh-tag-lock.lua`) but the
|
|
58
|
+
handler-side wiring lands in v0.2
|
|
59
|
+
- Provenance attestation is disabled for the local-publish flow; v0.2
|
|
60
|
+
will switch to GitHub Actions OIDC publish
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
9
64
|
### Added — `cacheHandlers` (plural) for `'use cache'`
|
|
10
65
|
|
|
11
66
|
- `createCacheComponentsHandler(opts)` factory implementing the full
|
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# @leejpsd/nextjs-cache-handler
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@leejpsd/nextjs-cache-handler)
|
|
4
|
+
[](./LICENSE)
|
|
5
|
+
|
|
6
|
+
> **Stable `v0.1.0`** — install with
|
|
7
|
+
> `npm install @leejpsd/nextjs-cache-handler`. Production-validated against
|
|
8
|
+
> AWS ECS Fargate with multi-instance Redis (24h live-traffic soak: 0
|
|
9
|
+
> errors, 0 leaks, 2ms Redis ping, namespace isolation working).
|
|
5
10
|
|
|
6
11
|
The Redis cache handler for **Next.js 16** that ships **both** `cacheHandler`
|
|
7
12
|
(ISR / Pages Router) **and** `cacheHandlers` (`'use cache'` directive,
|
|
@@ -44,21 +49,29 @@ As of 2026-05, the leading OSS Redis handler `@fortedigital/nextjs-cache-handler
|
|
|
44
49
|
declares `peerDependencies.next: ">=16.1.5"` but the README marks the new
|
|
45
50
|
plural interface as ❌ **"Not yet supported - Help needed"**:
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
52
|
+
> 📅 **Compatibility matrix verified 2026-05-10.** The OSS Next.js cache
|
|
53
|
+
> handler ecosystem moves quickly — please verify
|
|
54
|
+
> [`@fortedigital`](https://github.com/fortedigital/nextjs-cache-handler#compatibility)
|
|
55
|
+
> and
|
|
56
|
+
> [`nextjs-turbo-redis-cache`](https://github.com/trieb-work/nextjs-turbo-redis-cache#features)
|
|
57
|
+
> directly before relying on this comparison.
|
|
58
|
+
|
|
59
|
+
| Next 16 feature | this | @fortedigital 3.2.0 | nextjs-turbo-redis-cache 1.13 |
|
|
60
|
+
|---|---|---|---|
|
|
61
|
+
| `cacheHandlers` config (plural) | ✅ | ❌ Help needed | ✅ since 1.11 |
|
|
62
|
+
| `'use cache'` directive | ✅ | ❌ Help needed | ✅ since 1.11 |
|
|
63
|
+
| `'use cache: remote'` | ✅ | ❌ Help needed | partial |
|
|
64
|
+
| `'use cache: private'` | n/a (uncustomizable) | n/a | n/a |
|
|
65
|
+
| `cacheComponents: true` | ✅ | ❌ Help needed | ✅ |
|
|
66
|
+
| Build-phase skip (`PHASE_PRODUCTION_BUILD`) | ✅ | ✅ (singular only) | ✅ |
|
|
67
|
+
| Auto deploy isolation | ✅ `BUILD_NAMESPACE` env-resolved | manual | ✅ `BUILD_ID` since 1.13 |
|
|
68
|
+
| Lua-atomic SET+tag | ✅ Lua scripts | partial (MULTI) | partial |
|
|
69
|
+
| AbortSignal timeout | ✅ per-op | ✅ Proxy-wrapped | ❌ |
|
|
70
|
+
| Redis Cluster | ✅ (cluster adapter, see Production checklist) | ✅ | ✅ |
|
|
71
|
+
| ioredis support | ✅ | ✅ | ✅ |
|
|
72
|
+
| In-memory fallback (TTL-aware) | ✅ | partial | ✅ L1 + Redis L2 |
|
|
73
|
+
| OpenTelemetry hook | ✅ `onMetric` | ❌ | ❌ |
|
|
74
|
+
| Live-traffic dogfood (24h+) | ✅ AWS ECS Fargate | not published | not published |
|
|
62
75
|
|
|
63
76
|
PR [#207](https://github.com/fortedigital/nextjs-cache-handler/pull/207) on
|
|
64
77
|
`@fortedigital` has been stalled for 3+ months on the same issue: the
|
|
@@ -191,6 +204,13 @@ Full reference: [`docs/api.md`](./docs/api.md) (auto-generated).
|
|
|
191
204
|
to avoid static-chunk-404 issues during a deploy.
|
|
192
205
|
- [ ] **`abortTimeoutMs: 1500`** (default) — protects against a stuck Redis
|
|
193
206
|
connection from hanging the request thread.
|
|
207
|
+
- [ ] **Redis Cluster: set `hashTag: true`** — multi-key Lua scripts
|
|
208
|
+
(`set-with-tags.lua`, `revalidate-hard.lua`) require all KEYS to land
|
|
209
|
+
on the same hash slot. Without `hashTag`, cluster deployments will hit
|
|
210
|
+
`CROSSSLOT Keys in request don't hash to the same slot`. The flag wraps
|
|
211
|
+
the namespace in `{}` so every key for a given deploy hashes together.
|
|
212
|
+
Cluster support is implemented but **not yet load-tested at production
|
|
213
|
+
scale**; PRs welcome.
|
|
194
214
|
- [ ] **Redis `maxmemory-policy: allkeys-lru` or `noeviction`** — if you need
|
|
195
215
|
bounded memory, choose `allkeys-lru`. Otherwise `noeviction` keeps
|
|
196
216
|
tag indices intact.
|
|
@@ -200,6 +220,17 @@ Full reference: [`docs/api.md`](./docs/api.md) (auto-generated).
|
|
|
200
220
|
(separate from the handler) so a Redis outage surfaces in your
|
|
201
221
|
monitoring without inducing 5xx in user requests.
|
|
202
222
|
|
|
223
|
+
### Compatibility with Redis-protocol services
|
|
224
|
+
|
|
225
|
+
| Service | How to use | Tested? |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| **Self-hosted Redis 7+** | `{ type: "redis", url }` or `{ type: "ioredis", url }` | ✅ AWS ElastiCache 24h soak |
|
|
228
|
+
| **Redis Cluster** | `{ type: "cluster", nodes }` + `hashTag: true` | unit-tested, not yet load-tested at scale |
|
|
229
|
+
| **Upstash Redis** | `{ type: "redis", url: "rediss://..." }` (TLS auto-detected) | not yet validated, expected to work via the standard Redis protocol |
|
|
230
|
+
| **AWS ElastiCache (replication group)** | `{ type: "redis", url: "rediss://..." }` | ✅ reference deployment |
|
|
231
|
+
| **Vercel KV** | not yet supported — `@vercel/kv` adapter ships in v0.3 | — |
|
|
232
|
+
| **DragonflyDB / KeyDB** | Redis-protocol compatible — `{ type: "redis", url }` should work | not validated |
|
|
233
|
+
|
|
203
234
|
---
|
|
204
235
|
|
|
205
236
|
## How it differs from `@fortedigital/nextjs-cache-handler`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leejpsd/nextjs-cache-handler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "The only Redis cache handler for Next.js 16 that ships both cacheHandler (ISR) and cacheHandlers ('use cache') — production-validated for multi-instance deployments where @fortedigital lists 'Help needed'.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"next",
|