tricache 1.0.1 → 1.0.2
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/README.md +36 -28
- package/dist/{cache-service-CREOp7MM.d.ts → cache-service-B108FzER.d.ts} +36 -4
- package/dist/cache-service-CWI4jkS7.d.cts +963 -0
- package/dist/{cache-service-MG7PN6MX.js → cache-service-GYPZFB7O.js} +2 -2
- package/dist/{chunk-IITRFWHY.js → chunk-EUKB7RKP.js} +21 -4
- package/dist/{chunk-2AJKEQMZ.js → chunk-H4GFLQ26.js} +7 -4
- package/dist/{chunk-7RV5ZVBB.js → chunk-JNSLMK4Q.js} +111 -29
- package/dist/chunk-OYDU3SMI.js +89 -0
- package/dist/{chunk-3I5L7K6I.js → chunk-VNRDL5RA.js} +102 -140
- package/dist/{chunk-JYQFQJNJ.js → chunk-WYF7NOAT.js} +1443 -609
- package/dist/cli.cjs +1367 -625
- package/dist/cli.d.cts +12 -0
- package/dist/cli.js +27 -6
- package/dist/dashboard/index.cjs +111 -29
- package/dist/dashboard/index.d.cts +185 -0
- package/dist/dashboard/index.d.ts +5 -3
- package/dist/dashboard/index.js +1 -1
- package/dist/drizzle/index.cjs +1370 -624
- package/dist/drizzle/index.d.cts +46 -0
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/edge/index.cjs +227 -123
- package/dist/edge/index.d.cts +127 -0
- package/dist/edge/index.d.ts +3 -3
- package/dist/edge/index.js +201 -117
- package/dist/hono/index.cjs +1418 -644
- package/dist/hono/index.d.cts +93 -0
- package/dist/hono/index.d.ts +7 -5
- package/dist/hono/index.js +16 -9
- package/dist/{hono-DSV2ve66.d.ts → hono-3rDMYVtY.d.ts} +16 -3
- package/dist/hono-C886ok3X.d.cts +391 -0
- package/dist/http/index.cjs +1514 -679
- package/dist/http/index.d.cts +103 -0
- package/dist/http/index.d.ts +13 -5
- package/dist/http/index.js +92 -43
- package/dist/index.cjs +1671 -790
- package/dist/index.d.cts +1006 -0
- package/dist/index.d.ts +39 -8
- package/dist/index.js +8 -8
- package/dist/murmur3-CMGw9PbV.d.cts +98 -0
- package/dist/nestjs/index.cjs +1454 -649
- package/dist/nestjs/index.d.cts +285 -0
- package/dist/nestjs/index.d.ts +103 -30
- package/dist/nestjs/index.js +115 -32
- package/dist/next/index.cjs +1512 -718
- package/dist/next/index.d.cts +232 -0
- package/dist/next/index.d.ts +33 -11
- package/dist/next/index.js +172 -99
- package/dist/prisma/index.cjs +11 -1
- package/dist/prisma/index.d.cts +62 -0
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +11 -1
- package/dist/serialize-worker.d.cts +2 -0
- package/dist/{types-Dyip5wAl.d.ts → types-BA4pz1A0.d.cts} +24 -9
- package/dist/types-BA4pz1A0.d.ts +1519 -0
- package/dist/{utils-CEsU_Z0s.d.ts → utils-Bvzn-rKS.d.cts} +3 -1
- package/dist/utils-Bvzn-rKS.d.ts +29 -0
- package/package.json +96 -36
- package/src/adapters/auto-pipeliner.ts +107 -24
- package/src/adapters/node-redis.ts +106 -27
- package/src/cache-service.ts +802 -502
- package/src/cli.ts +24 -6
- package/src/cross-region.ts +21 -3
- package/src/dashboard/handler.ts +26 -6
- package/src/dashboard/html.ts +35 -10
- package/src/dashboard/index.ts +35 -13
- package/src/dashboard/types.ts +3 -1
- package/src/disk-tier.ts +171 -65
- package/src/edge/cache.ts +145 -97
- package/src/edge/hono.ts +23 -6
- package/src/edge/types.ts +2 -0
- package/src/hono/index.ts +19 -9
- package/src/http/express.ts +62 -17
- package/src/http/fastify.ts +35 -21
- package/src/http/utils.ts +54 -20
- package/src/ipc-telemetry.ts +35 -9
- package/src/nestjs/decorators.ts +1 -1
- package/src/nestjs/index.ts +2 -0
- package/src/nestjs/keyv-adapter.ts +68 -0
- package/src/nestjs/tricache.module.ts +13 -11
- package/src/nestjs/tricache.store.ts +51 -20
- package/src/nestjs/types.ts +29 -15
- package/src/next/cache-handler.ts +131 -53
- package/src/next/index.ts +1 -0
- package/src/next/types.ts +21 -0
- package/src/prisma/index.ts +12 -1
- package/src/smart-memory-cache.ts +63 -26
- package/src/types.ts +25 -2
- package/src/utils/cgroup.ts +12 -0
- package/src/utils/deadline.ts +14 -0
- package/src/utils/diagnostics.ts +27 -0
- package/src/utils/redis-slot.ts +13 -0
- package/src/wasm/bloom-filter-wasm.ts +9 -4
- package/src/worker-pool.ts +17 -8
- package/src/wtiny-lfu.ts +20 -6
- package/dist/chunk-BQRURGGD.js +0 -60
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://kareem411.github.io/TriCache/)
|
|
5
5
|
[](https://www.npmjs.com/package/tricache)
|
|
6
6
|
[](https://www.npmjs.com/package/tricache)
|
|
7
|
-
[](tests)
|
|
8
8
|
[](src)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://nodejs.org)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
> 🌐 **Documentation Site**: **[https://kareem411.github.io/TriCache/](https://kareem411.github.io/TriCache/)**
|
|
13
13
|
> 📦 **npm Package**: **[`npm install tricache`](https://www.npmjs.com/package/tricache)**
|
|
14
14
|
|
|
15
|
-
**TriCache** is
|
|
15
|
+
**TriCache** is a three-tier caching engine for Node.js: **L1 RAM** $\rightarrow$ **L1.5 disk or `/dev/shm` spill** $\rightarrow$ **L2 Redis/Valkey**. It combines bounded local storage, per-process singleflight, configurable stale-while-revalidate, and distributed invalidation. Performance and savings depend on your workload; [benchmark your deployment](BENCHMARKS.md).
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -27,16 +27,17 @@ import { CacheService } from 'tricache';
|
|
|
27
27
|
|
|
28
28
|
// 1. One-line preset: W-TinyLFU, Redis Streams, /dev/shm off-heap spill, & SWR
|
|
29
29
|
const cache = CacheService.preset('nextjs', { redisHost: process.env.REDIS_HOST });
|
|
30
|
+
await cache.ready();
|
|
30
31
|
|
|
31
32
|
// 2. Get-or-fetch with thundering-herd coalescing & 60s background SWR
|
|
32
33
|
const user = await cache.get(
|
|
33
34
|
`user:${userId}`,
|
|
34
35
|
() => db.users.findById(userId),
|
|
35
36
|
300, // 5-minute TTL
|
|
36
|
-
{ swr: 60 } // Serve stale for 60s while refreshing in the background
|
|
37
|
+
{ swr: 60, tags: ['users'] } // Serve stale for 60s while refreshing in the background
|
|
37
38
|
);
|
|
38
39
|
|
|
39
|
-
// 3.
|
|
40
|
+
// 3. Bump a concrete tag generation and publish invalidation to peers
|
|
40
41
|
await cache.invalidateTag('users');
|
|
41
42
|
```
|
|
42
43
|
|
|
@@ -49,26 +50,26 @@ await cache.invalidateTag('users');
|
|
|
49
50
|
│
|
|
50
51
|
▼
|
|
51
52
|
┌──────────────────────────────────────────────────┐
|
|
52
|
-
│ L1: Smart Memory (W-TinyLFU + CMS) │
|
|
53
|
-
│ Window LRU (1%) + Segmented Main SLRU (99%) │
|
|
53
|
+
│ L1: Smart Memory (W-TinyLFU + CMS) │ Bounded RAM
|
|
54
|
+
│ Window LRU (1%) + Segmented Main SLRU (99%) │ Packed values
|
|
54
55
|
└────────────────────────┬─────────────────────────┘
|
|
55
56
|
│ Miss / Eviction Spill
|
|
56
57
|
▼
|
|
57
58
|
┌──────────────────────────────────────────────────┐
|
|
58
|
-
│ L1.5: Off-Heap /dev/shm & NVMe Spill Tier │
|
|
59
|
-
│
|
|
59
|
+
│ L1.5: Off-Heap /dev/shm & NVMe Spill Tier │ Bounded I/O
|
|
60
|
+
│ tmpfs counts toward container memory usage │ Writable mount needed
|
|
60
61
|
└────────────────────────┬─────────────────────────┘
|
|
61
62
|
│ Miss
|
|
62
63
|
▼
|
|
63
64
|
┌──────────────────────────────────────────────────┐
|
|
64
65
|
│ L2: Redis / Valkey Distributed Tier │ ~1.2 ms (Network)
|
|
65
|
-
│ AES-
|
|
66
|
+
│ Optional AES-GCM + expiry/tag metadata │ Pipelined commands
|
|
66
67
|
└────────────────────────┬─────────────────────────┘
|
|
67
68
|
│ Complete Cache Miss
|
|
68
69
|
▼
|
|
69
70
|
┌──────────────────────────────────────────────────┐
|
|
70
|
-
│ Upstream Database / API (Singleflight
|
|
71
|
-
│ Inflight Promise Map coalesces
|
|
71
|
+
│ Upstream Database / API (Singleflight) │ Per process/key
|
|
72
|
+
│ Inflight Promise Map coalesces concurrent work│ Not a fleet-wide lock
|
|
72
73
|
└──────────────────────────────────────────────────┘
|
|
73
74
|
```
|
|
74
75
|
|
|
@@ -77,32 +78,31 @@ await cache.invalidateTag('users');
|
|
|
77
78
|
* **Off-Heap `/dev/shm` RAM Spill**: Targets Linux POSIX shared memory tmpfs ($\ge 256\text{MB}$ total, $\ge 128\text{MB}$ free), burning 0 cloud IOPS. [[SRE Guide $\rightarrow$](https://kareem411.github.io/TriCache/kubernetes-production-guide)]
|
|
78
79
|
* **Dynamic Latency Watchdog**: Graduated shedding (0% $\rightarrow$ 25% $\rightarrow$ 75% $\rightarrow$ 100%) with asymmetric Redis hysteresis (15ms cutoff, 10ms recovery floor).
|
|
79
80
|
* **Ephemeral Quotas & K8s Eviction Defense**: Chunked watermark pruning (80% $\rightarrow$ 60% in 500-entry batches) and proactive $<10\%$ space spill pauses.
|
|
80
|
-
* **Wildcard & Hierarchical Tag Invalidation**:
|
|
81
|
+
* **Wildcard & Hierarchical Tag Invalidation**: Concrete generation bumps are $O(1)$; wildcard and hierarchy resolution scan matching tag metadata.
|
|
81
82
|
* **Differential Multi-Tier Waterfall Batching**: Cascading `cache.mget` resolves L1 $\rightarrow$ L2 $\rightarrow$ Disk $\rightarrow$ DB miss fetch with zero $N+1$ queries.
|
|
82
83
|
* **Zero-Dependency Cloud Hydration (SigV4)**: Hydrates cold pods from S3/R2 in milliseconds via native Web Crypto. [[Cloud Guide $\rightarrow$](https://kareem411.github.io/TriCache/cold-start-cloud-hydration)]
|
|
83
84
|
|
|
84
85
|
---
|
|
85
86
|
|
|
86
|
-
## 🏆 Feature
|
|
87
|
+
## 🏆 Feature Overview
|
|
87
88
|
|
|
88
|
-
|
|
|
89
|
-
|
|
90
|
-
| **Storage
|
|
91
|
-
| **
|
|
92
|
-
| **
|
|
93
|
-
| **
|
|
94
|
-
| **
|
|
95
|
-
| **
|
|
96
|
-
| **
|
|
97
|
-
| **
|
|
98
|
-
| **Encryption at Rest** | ❌ None | ❌ None | ❌ None | **✅ AES-256-GCM / Web Crypto AEAD** |
|
|
89
|
+
| Feature | Behavior |
|
|
90
|
+
|:---|:---|
|
|
91
|
+
| **Storage hierarchy** | RAM → eligible disk/tmpfs spill → Redis/Valkey |
|
|
92
|
+
| **Singleflight** | Coalesces concurrent work per process and key |
|
|
93
|
+
| **Tag invalidation** | Concrete generation bumps; metadata scans for patterns/cascades |
|
|
94
|
+
| **Backplane** | Pub/Sub or retained-event Redis Streams replay |
|
|
95
|
+
| **Compression** | Zstandard with fallback; optional Brotli, gzip, LZ4, or custom compressor |
|
|
96
|
+
| **Batch reads** | Resolves cached keys and fetches only remaining misses |
|
|
97
|
+
| **Resource controls** | Packed-data limits, bounded disk I/O, and cgroup pressure guards |
|
|
98
|
+
| **Encryption** | Optional AES-GCM for Node and Web Crypto edge storage |
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
102
102
|
## 🎯 Production Presets (`CacheService.preset`)
|
|
103
103
|
|
|
104
104
|
```typescript
|
|
105
|
-
// 1. Next.js 16
|
|
105
|
+
// 1. Next.js 16 App Router (React 19 RSC streams & generational tags)
|
|
106
106
|
const cache = CacheService.preset('nextjs', { redisHost: 'redis.internal' });
|
|
107
107
|
|
|
108
108
|
// 2. High-Throughput Microservice (Streams backplane, TTL jitter, circuit breakers)
|
|
@@ -121,16 +121,24 @@ const cache = CacheService.preset('enterprise-hardened', { redisHost: 'redis.int
|
|
|
121
121
|
|
|
122
122
|
| Integration | Import Path | Description |
|
|
123
123
|
|:---|:---|:---|
|
|
124
|
-
| **Next.js 16
|
|
125
|
-
| **NestJS
|
|
124
|
+
| **Next.js 16** | `tricache/next` | Native Cache Components `cacheHandlers` with bounded RSC streams, timing preservation, and soft-tag expiry. |
|
|
125
|
+
| **NestJS 10–12** | `tricache/nestjs` | `TriCacheModule`, millisecond TTL facade, Keyv 5/cache-manager 7 adapter, and `@Cacheable`. |
|
|
126
126
|
| **Prisma ORM** | `tricache/prisma` | `$extends` client extension with query hashing and auto-mutation tag eviction. |
|
|
127
127
|
| **Drizzle ORM** | `tricache/drizzle` | `withCache(query, opts)` query wrapper with SQL+parameters hashing and background SWR. |
|
|
128
128
|
| **Express & Fastify** | `tricache/http` | Route caching middleware with deterministic query sorting, weak ETag, and `304 Not Modified`. |
|
|
129
|
-
| **Node Hono** | `tricache/hono` |
|
|
129
|
+
| **Node Hono** | `tricache/hono` | Response caching with TTL/tags, privacy guards, and `304 Not Modified`. |
|
|
130
130
|
| **Edge Isolates & Hono** | `tricache/edge` | Zero-Node-dependency implementation for Cloudflare Workers, Fastly Compute, Hono, and Vercel Edge. |
|
|
131
131
|
| **SSE Dashboard** | `tricache/dashboard` | Zero-dependency Server-Sent Events real-time admin dashboard. |
|
|
132
132
|
| **Live CLI Top** | `npx tricache top` | Real-time terminal ASCII monitor over Unix sockets and Windows named pipes. |
|
|
133
133
|
|
|
134
|
+
### Safety and consistency
|
|
135
|
+
|
|
136
|
+
- HTTP middleware bypasses credentialed requests by default and excludes private, cookie-setting, partial, and unkeyed `Vary` responses. Response refreshes run on live requests; use `cache.get()`/`wrap()` for data-level SWR.
|
|
137
|
+
- Dashboard access should be authenticated and private. It defaults to `readOnly: true`; administrative writes require explicit opt-in.
|
|
138
|
+
- Redis Streams provide replay only while events are retained. A detected gap flushes local state. `awaitInvalidationBackplane: true` confirms publication, not peer acknowledgments or exactly-once delivery.
|
|
139
|
+
- Redis promotions preserve remaining TTL where supported. Custom drivers without atomic expiry reads use fallback TTLs; edge legacy JSON without expiry metadata is read without local promotion.
|
|
140
|
+
- `/dev/shm` reduces disk I/O but still consumes container memory. Encryption and cache configuration do not by themselves establish regulatory compliance.
|
|
141
|
+
|
|
134
142
|
---
|
|
135
143
|
|
|
136
144
|
## 📚 Documentation & Deep Dives
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CacheOptions, b as CacheMetrics, c as CacheHealthStatus, d as CachePresetType, e as CrossRegionInvalidationEvent, f as CachePriority, W as WrapOptions, a as InvalidateTagOptions, g as CachePingResult, D as DiskBackpressureStats, L as LockOptions, E as EncryptionMode, h as WTinyLfuStats } from './types-
|
|
1
|
+
import { C as CacheOptions, b as CacheMetrics, c as CacheHealthStatus, d as CachePresetType, e as CrossRegionInvalidationEvent, f as CachePriority, W as WrapOptions, a as InvalidateTagOptions, g as CachePingResult, D as DiskBackpressureStats, L as LockOptions, E as EncryptionMode, h as WTinyLfuStats } from './types-BA4pz1A0.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* TierLatencyWatchdog — Graduated, self-healing tier latency watchdog.
|
|
@@ -141,6 +141,8 @@ declare class IpcTelemetryServer {
|
|
|
141
141
|
private server;
|
|
142
142
|
readonly socketPath: string;
|
|
143
143
|
private _closed;
|
|
144
|
+
private _starting;
|
|
145
|
+
private readonly sockets;
|
|
144
146
|
private _exitHandler;
|
|
145
147
|
private _sigintHandler;
|
|
146
148
|
private _sigtermHandler;
|
|
@@ -149,6 +151,7 @@ declare class IpcTelemetryServer {
|
|
|
149
151
|
* Start listening on the IPC socket / pipe.
|
|
150
152
|
*/
|
|
151
153
|
start(): Promise<void>;
|
|
154
|
+
private startInternal;
|
|
152
155
|
/**
|
|
153
156
|
* Build a complete telemetry snapshot from the underlying cache provider.
|
|
154
157
|
*/
|
|
@@ -241,6 +244,7 @@ declare class CacheService {
|
|
|
241
244
|
private readonly keyTags;
|
|
242
245
|
/** tag → { version, lastSyncedAt } for generational tag invalidation (bounded to 10,000 entries) */
|
|
243
246
|
private readonly tagVersions;
|
|
247
|
+
private _tagRefreshEpoch;
|
|
244
248
|
/**
|
|
245
249
|
* Dependency index: source glob pattern → Set of namespaced dependent keys.
|
|
246
250
|
* When an exact-key delete matches a registered pattern, all dependents are cascaded.
|
|
@@ -271,9 +275,17 @@ declare class CacheService {
|
|
|
271
275
|
private subClient;
|
|
272
276
|
private streamClient;
|
|
273
277
|
private _lastStreamId;
|
|
278
|
+
private _restoredSnapshot;
|
|
279
|
+
private _backplaneAvailable;
|
|
280
|
+
private _otelCleanup;
|
|
281
|
+
private _streamRecovering;
|
|
282
|
+
private readonly _backplaneDisposers;
|
|
274
283
|
private _destroyed;
|
|
275
284
|
private readonly _pendingDiskDeletes;
|
|
276
285
|
private _globalEpoch;
|
|
286
|
+
private _pendingSpillCount;
|
|
287
|
+
private _suppressSpills;
|
|
288
|
+
private _diskCleanupScheduled;
|
|
277
289
|
private readonly _keyMutationEpochs;
|
|
278
290
|
/**
|
|
279
291
|
* Pattern tombstones for disk tier.
|
|
@@ -282,15 +294,26 @@ declare class CacheService {
|
|
|
282
294
|
* pattern tombstones in memory to intercept subsequent disk reads and evict matching files.
|
|
283
295
|
*/
|
|
284
296
|
private readonly _patternTombstones;
|
|
297
|
+
private _diskInvalidatedBefore;
|
|
285
298
|
private _addPatternTombstone;
|
|
286
299
|
private _isTombstonedByPattern;
|
|
287
300
|
private _assertActive;
|
|
288
301
|
private _bumpKeyMutation;
|
|
289
302
|
private _getKeyMutationEpoch;
|
|
303
|
+
/** Capture a commit fence before asynchronous computation outside the cache. */
|
|
304
|
+
captureMutationFence(cacheKey: string): () => boolean;
|
|
305
|
+
/** Force tag re-sync without forgetting locally observed monotonic generations. */
|
|
306
|
+
refreshTagVersions(): void;
|
|
307
|
+
private _fenceInvalidation;
|
|
308
|
+
private _invalidateDiskKey;
|
|
309
|
+
private _scheduleDiskCleanup;
|
|
310
|
+
private _registerDependencies;
|
|
311
|
+
private _rememberTags;
|
|
312
|
+
private _restoreEntryMetadata;
|
|
290
313
|
private _removeKeyTags;
|
|
291
314
|
private _removeKeyDependencies;
|
|
292
315
|
private _handleL1Eviction;
|
|
293
|
-
private
|
|
316
|
+
private _removePatternFromIndices;
|
|
294
317
|
private _sweepExpiredMetadata;
|
|
295
318
|
private _runOomCheck;
|
|
296
319
|
private _ipcServer?;
|
|
@@ -342,7 +365,7 @@ declare class CacheService {
|
|
|
342
365
|
private static optionsDiff;
|
|
343
366
|
/** Increment the singleton-divergence counter (surfaced in `metrics()`). */
|
|
344
367
|
bumpSingletonDivergence(): void;
|
|
345
|
-
/**
|
|
368
|
+
/** Sanitized diagnostic view; retain the original options/adapters to reuse configuration. */
|
|
346
369
|
get options(): CacheOptions;
|
|
347
370
|
/**
|
|
348
371
|
* Async factory — accepts a Promise that resolves to CacheOptions.
|
|
@@ -374,7 +397,9 @@ declare class CacheService {
|
|
|
374
397
|
/** Start an OTEL-compatible span if a tracer is configured. Returns a no-op span otherwise. */
|
|
375
398
|
private _startSpan;
|
|
376
399
|
private createDedicatedRedisClient;
|
|
400
|
+
private _listenBackplane;
|
|
377
401
|
private initBackplane;
|
|
402
|
+
private _resetAfterStreamGap;
|
|
378
403
|
private _startStreamConsumer;
|
|
379
404
|
/**
|
|
380
405
|
* Validate + apply one XREAD stream entry. `fields` is the flat ioredis
|
|
@@ -406,6 +431,11 @@ declare class CacheService {
|
|
|
406
431
|
private _parseGenerationalRedisHash;
|
|
407
432
|
private _readRedisEntry;
|
|
408
433
|
private _getTagVersion;
|
|
434
|
+
private _readRedisBatch;
|
|
435
|
+
private _promoteRedisEntry;
|
|
436
|
+
private _readDiskEntry;
|
|
437
|
+
/** Common write policy and metadata across get/set/revalidation/draining. */
|
|
438
|
+
private _writeRedisEntry;
|
|
409
439
|
private _deleteIfStale;
|
|
410
440
|
/**
|
|
411
441
|
* Serialize payload for L2 Redis storage applying compression and encryption as configured.
|
|
@@ -482,6 +512,8 @@ declare class CacheService {
|
|
|
482
512
|
* On an L1/L2 hit the tags are already registered — this field is a no-op for hits.
|
|
483
513
|
*/
|
|
484
514
|
tags?: string[];
|
|
515
|
+
/** Dependency patterns registered when a miss populates the entry. */
|
|
516
|
+
dependsOn?: string[];
|
|
485
517
|
}): Promise<T>;
|
|
486
518
|
/**
|
|
487
519
|
* Graceful shutdown flusher for Kubernetes preStop hooks, NestJS onApplicationShutdown,
|
|
@@ -621,7 +653,7 @@ declare class CacheService {
|
|
|
621
653
|
*/
|
|
622
654
|
scan<T = unknown>(fn: (rawKey: string, value: T, offset: number) => void): void;
|
|
623
655
|
/**
|
|
624
|
-
|
|
656
|
+
* Extend the TTL of a key in L1 and Redis without fetching.
|
|
625
657
|
* Returns `false` if the key is absent or already expired.
|
|
626
658
|
*
|
|
627
659
|
* @param newTtlSeconds - The new TTL from now, in seconds.
|