@leejpsd/nextjs-cache-handler 0.4.1 → 1.0.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/CHANGELOG.md +32 -0
- package/README.md +44 -15
- package/dist/cache-components/index.cjs +59 -37
- package/dist/cache-components/index.cjs.map +1 -1
- package/dist/cache-components/index.d.cts +2 -2
- package/dist/cache-components/index.d.ts +2 -2
- package/dist/cache-components/index.js +59 -37
- package/dist/cache-components/index.js.map +1 -1
- package/dist/incremental/index.cjs.map +1 -1
- package/dist/incremental/index.d.cts +2 -2
- package/dist/incremental/index.d.ts +2 -2
- package/dist/incremental/index.js.map +1 -1
- package/dist/index.cjs +59 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +59 -37
- package/dist/index.js.map +1 -1
- package/dist/ops/index.d.cts +1 -1
- package/dist/ops/index.d.ts +1 -1
- package/dist/otel/index.d.cts +1 -1
- package/dist/otel/index.d.ts +1 -1
- package/dist/seed/index.d.cts +1 -1
- package/dist/seed/index.d.ts +1 -1
- package/dist/shared/client/adapter-ioredis.d.cts +1 -1
- package/dist/shared/client/adapter-ioredis.d.ts +1 -1
- package/dist/shared/client/adapter-redis.d.cts +1 -1
- package/dist/shared/client/adapter-redis.d.ts +1 -1
- package/dist/{types-C1vJ_sED.d.cts → types-YbDAllyp.d.cts} +7 -1
- package/dist/{types-C1vJ_sED.d.ts → types-YbDAllyp.d.ts} +7 -1
- package/package.json +7 -5
package/dist/ops/index.d.cts
CHANGED
package/dist/ops/index.d.ts
CHANGED
package/dist/otel/index.d.cts
CHANGED
package/dist/otel/index.d.ts
CHANGED
package/dist/seed/index.d.cts
CHANGED
package/dist/seed/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cluster, Redis } from 'ioredis';
|
|
2
|
-
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-
|
|
2
|
+
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-YbDAllyp.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Adapter for `ioredis` (and `ioredis.Cluster`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cluster, Redis } from 'ioredis';
|
|
2
|
-
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-
|
|
2
|
+
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-YbDAllyp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Adapter for `ioredis` (and `ioredis.Cluster`).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RedisClientType } from 'redis';
|
|
2
|
-
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-
|
|
2
|
+
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-YbDAllyp.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Adapter for `redis@5` (the official `node-redis` client).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RedisClientType } from 'redis';
|
|
2
|
-
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-
|
|
2
|
+
import { R as RedisClientLike, a as RedisClientConfig } from '../../types-YbDAllyp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Adapter for `redis@5` (the official `node-redis` client).
|
|
@@ -105,7 +105,7 @@ type FallbackStrategy = "auto" | "always" | "never";
|
|
|
105
105
|
* Optional — when not provided, only the process-local counters in
|
|
106
106
|
* `src/shared/metrics.ts` are updated.
|
|
107
107
|
*/
|
|
108
|
-
type MetricEventType = "cache.hit" | "cache.miss" | "cache.get.deduped" | "cache.stale" | "cache.stale.refresh.leader" | "cache.stale.refresh.follower" | "cache.set" | "cache.set.failed" | "tag.invalidate.soft" | "tag.invalidate.hard" | "tag.expiration.read" | "redis.connect.failed" | "redis.timeout" | "fallback.activated" | "build_phase.skip";
|
|
108
|
+
type MetricEventType = "cache.hit" | "cache.miss" | "cache.get.deduped" | "cache.stale" | "cache.stale.refresh.leader" | "cache.stale.refresh.follower" | "cache.set" | "cache.set.failed" | "cache.set.skipped" | "tag.invalidate.soft" | "tag.invalidate.hard" | "tag.expiration.read" | "redis.connect.failed" | "redis.timeout" | "fallback.activated" | "build_phase.skip";
|
|
109
109
|
interface MetricEvent {
|
|
110
110
|
type: MetricEventType;
|
|
111
111
|
/** Operation latency in milliseconds, when measurable. */
|
|
@@ -188,6 +188,12 @@ interface CacheHandlerOptions {
|
|
|
188
188
|
*
|
|
189
189
|
* Default: `true`. Set to `false` to revert to "expire on revalidate" behavior.
|
|
190
190
|
*/
|
|
191
|
+
/**
|
|
192
|
+
* Governs TIME-based staleness only (serve-stale within revalidate..expire).
|
|
193
|
+
* Since 0.4.2 tag invalidation ignores this option: soft (profile-based)
|
|
194
|
+
* invalidations always serve-while-revalidating and hard ones always miss —
|
|
195
|
+
* that split is the upstream contract, not a handler feature.
|
|
196
|
+
*/
|
|
191
197
|
staleWhileRevalidate?: boolean;
|
|
192
198
|
/**
|
|
193
199
|
* Push-based cross-instance tag propagation (plural handler only).
|
|
@@ -105,7 +105,7 @@ type FallbackStrategy = "auto" | "always" | "never";
|
|
|
105
105
|
* Optional — when not provided, only the process-local counters in
|
|
106
106
|
* `src/shared/metrics.ts` are updated.
|
|
107
107
|
*/
|
|
108
|
-
type MetricEventType = "cache.hit" | "cache.miss" | "cache.get.deduped" | "cache.stale" | "cache.stale.refresh.leader" | "cache.stale.refresh.follower" | "cache.set" | "cache.set.failed" | "tag.invalidate.soft" | "tag.invalidate.hard" | "tag.expiration.read" | "redis.connect.failed" | "redis.timeout" | "fallback.activated" | "build_phase.skip";
|
|
108
|
+
type MetricEventType = "cache.hit" | "cache.miss" | "cache.get.deduped" | "cache.stale" | "cache.stale.refresh.leader" | "cache.stale.refresh.follower" | "cache.set" | "cache.set.failed" | "cache.set.skipped" | "tag.invalidate.soft" | "tag.invalidate.hard" | "tag.expiration.read" | "redis.connect.failed" | "redis.timeout" | "fallback.activated" | "build_phase.skip";
|
|
109
109
|
interface MetricEvent {
|
|
110
110
|
type: MetricEventType;
|
|
111
111
|
/** Operation latency in milliseconds, when measurable. */
|
|
@@ -188,6 +188,12 @@ interface CacheHandlerOptions {
|
|
|
188
188
|
*
|
|
189
189
|
* Default: `true`. Set to `false` to revert to "expire on revalidate" behavior.
|
|
190
190
|
*/
|
|
191
|
+
/**
|
|
192
|
+
* Governs TIME-based staleness only (serve-stale within revalidate..expire).
|
|
193
|
+
* Since 0.4.2 tag invalidation ignores this option: soft (profile-based)
|
|
194
|
+
* invalidations always serve-while-revalidating and hard ones always miss —
|
|
195
|
+
* that split is the upstream contract, not a handler feature.
|
|
196
|
+
*/
|
|
191
197
|
staleWhileRevalidate?: boolean;
|
|
192
198
|
/**
|
|
193
199
|
* Push-based cross-instance tag propagation (plural handler only).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leejpsd/nextjs-cache-handler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Redis cache handler for Next.js 15/16 — the only one shipping both cacheHandler (ISR) and cacheHandlers ('use cache') with built-in compression, Redis Sentinel, and OpenTelemetry. Production-validated on multi-instance AWS: reconnect backoff, cross-instance tag invalidation, zero-downtime Redis failover.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"next",
|
|
@@ -178,13 +178,14 @@
|
|
|
178
178
|
"prepublishOnly": "npm run verify && npm run publint && npm run attw",
|
|
179
179
|
"test:cluster": "vitest run --config vitest.cluster.config.ts",
|
|
180
180
|
"test:cluster:up": "scripts/cluster-test-env.sh up",
|
|
181
|
-
"test:cluster:down": "scripts/cluster-test-env.sh down"
|
|
181
|
+
"test:cluster:down": "scripts/cluster-test-env.sh down",
|
|
182
|
+
"og": "node tools/generate-og.mjs"
|
|
182
183
|
},
|
|
183
184
|
"peerDependencies": {
|
|
184
|
-
"
|
|
185
|
-
"redis": ">=5.0.0",
|
|
185
|
+
"@opentelemetry/api": ">=1.0.0",
|
|
186
186
|
"ioredis": ">=5.0.0",
|
|
187
|
-
"
|
|
187
|
+
"next": ">=15.0.0 <17",
|
|
188
|
+
"redis": ">=5.0.0"
|
|
188
189
|
},
|
|
189
190
|
"peerDependenciesMeta": {
|
|
190
191
|
"redis": {
|
|
@@ -208,6 +209,7 @@
|
|
|
208
209
|
"eslint": "^9.18.0",
|
|
209
210
|
"ioredis": "^5.4.0",
|
|
210
211
|
"next": "^16.1.5",
|
|
212
|
+
"playwright": "^1.60.0",
|
|
211
213
|
"prettier": "^3.4.0",
|
|
212
214
|
"publint": "^0.3.0",
|
|
213
215
|
"redis": "^5.0.0",
|