tricache 0.9.0 → 1.0.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/README.md +7 -3
- package/dist/{cache-service-DVvroyqA.d.ts → cache-service-CREOp7MM.d.ts} +57 -12
- package/dist/{cache-service-KI5ACF3F.js → cache-service-MG7PN6MX.js} +3 -3
- package/dist/{chunk-XZL45ABR.js → chunk-2AJKEQMZ.js} +54 -1
- package/dist/{chunk-QNU7B43J.js → chunk-3I5L7K6I.js} +17 -0
- package/dist/{chunk-PL5J3ZNT.js → chunk-JYQFQJNJ.js} +682 -277
- package/dist/{chunk-LJ5QJB5O.js → chunk-UBWLPKTI.js} +127 -11
- package/dist/cli.cjs +857 -293
- package/dist/cli.js +4 -4
- package/dist/dashboard/index.d.ts +2 -2
- package/dist/drizzle/index.cjs +865 -294
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/edge/index.cjs +115 -36
- package/dist/edge/index.d.ts +3 -3
- package/dist/edge/index.js +88 -37
- package/dist/hono/index.cjs +865 -294
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/index.js +1 -1
- package/dist/{hono-VA9A1m0I.d.ts → hono-DSV2ve66.d.ts} +11 -4
- package/dist/http/index.cjs +917 -315
- package/dist/http/index.d.ts +3 -3
- package/dist/http/index.js +60 -29
- package/dist/index.cjs +885 -294
- package/dist/index.d.ts +37 -7
- package/dist/index.js +16 -6
- package/dist/nestjs/index.cjs +856 -292
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +4 -4
- package/dist/next/index.cjs +858 -300
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +5 -11
- package/dist/prisma/index.d.ts +2 -2
- package/dist/serialize-worker.cjs +127 -9
- package/dist/serialize-worker.js +8 -4
- package/dist/{types-B_QkVwJ7.d.ts → types-Dyip5wAl.d.ts} +53 -7
- package/package.json +7 -4
- package/src/adapters/node-redis.ts +19 -0
- package/src/cache-service.ts +781 -297
- package/src/cli.ts +1 -1
- package/src/compression.ts +193 -15
- package/src/cross-region.ts +1 -1
- package/src/edge/cache.ts +94 -42
- package/src/env.d.ts +13 -0
- package/src/http/express.ts +55 -16
- package/src/http/fastify.ts +3 -7
- package/src/index.ts +9 -1
- package/src/next/cache-handler.ts +1 -4
- package/src/next/isr-handler.ts +1 -4
- package/src/serialize-worker.ts +6 -2
- package/src/smart-memory-cache.ts +3 -2
- package/src/types.ts +45 -5
- package/src/utils/tag-matcher.ts +90 -0
package/dist/hono/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CacheService } from '../cache-service-
|
|
2
|
-
import { W as WrapOptions } from '../types-
|
|
1
|
+
import { C as CacheService } from '../cache-service-CREOp7MM.js';
|
|
2
|
+
import { W as WrapOptions } from '../types-Dyip5wAl.js';
|
|
3
3
|
import { K as KeyDerivationOptions } from '../utils-CEsU_Z0s.js';
|
|
4
4
|
import 'crypto';
|
|
5
5
|
|
package/dist/hono/index.js
CHANGED
|
@@ -143,7 +143,7 @@ function cacheMiddleware(options = {}) {
|
|
|
143
143
|
return await next();
|
|
144
144
|
}
|
|
145
145
|
if (!resolvedCache) {
|
|
146
|
-
const { CacheService } = await import("../cache-service-
|
|
146
|
+
const { CacheService } = await import("../cache-service-MG7PN6MX.js");
|
|
147
147
|
resolvedCache = CacheService.create();
|
|
148
148
|
}
|
|
149
149
|
const activeCache = resolvedCache;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as ICacheTracer } from './types-
|
|
1
|
+
import { I as ICacheTracer, a as InvalidateTagOptions } from './types-Dyip5wAl.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pluggable asynchronous key-value storage adapter for Edge runtimes (L2 tier).
|
|
@@ -238,6 +238,7 @@ declare class EdgeCacheService {
|
|
|
238
238
|
private currentBytes;
|
|
239
239
|
private readonly inflight;
|
|
240
240
|
private readonly tagIndex;
|
|
241
|
+
private static readonly MAX_TAG_VERSION_CACHE;
|
|
241
242
|
private readonly tagVersionCache;
|
|
242
243
|
private readonly tagVersionTtlMs;
|
|
243
244
|
constructor(options?: EdgeCacheOptions);
|
|
@@ -250,6 +251,7 @@ declare class EdgeCacheService {
|
|
|
250
251
|
private _evictIfNeeded;
|
|
251
252
|
private _deleteL1;
|
|
252
253
|
private _startSpan;
|
|
254
|
+
private _setTagVersionCache;
|
|
253
255
|
private _getTagVersion;
|
|
254
256
|
private _batchGetTagVersions;
|
|
255
257
|
/**
|
|
@@ -263,15 +265,20 @@ declare class EdgeCacheService {
|
|
|
263
265
|
set<T>(key: string, value: T, ttlSeconds?: number, options?: {
|
|
264
266
|
tags?: string[];
|
|
265
267
|
swr?: number;
|
|
266
|
-
}): Promise<void>;
|
|
268
|
+
} | string[]): Promise<void>;
|
|
267
269
|
/**
|
|
268
270
|
* Deletes a key from all tiers.
|
|
269
271
|
*/
|
|
270
272
|
delete(key: string): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Executes invalidation for a single already-resolved concrete tag without
|
|
275
|
+
* re-entering wildcard/cascade resolution.
|
|
276
|
+
*/
|
|
277
|
+
private _invalidateConcreteTag;
|
|
271
278
|
/**
|
|
272
279
|
* Invalidates all cached entries associated with a tag.
|
|
273
280
|
*/
|
|
274
|
-
invalidateTag(tag: string): Promise<void>;
|
|
281
|
+
invalidateTag(tag: string, opts?: InvalidateTagOptions): Promise<void>;
|
|
275
282
|
/**
|
|
276
283
|
* Clears all entries from the edge cache.
|
|
277
284
|
*/
|
|
@@ -279,7 +286,7 @@ declare class EdgeCacheService {
|
|
|
279
286
|
/**
|
|
280
287
|
* Batch get with miss-fetching.
|
|
281
288
|
*/
|
|
282
|
-
mget<T>(keys: string[], fetchFn?: (missKeys: string[]) => Promise<Record<string, T>>, ttlSeconds?: number): Promise<(T | null)[]>;
|
|
289
|
+
mget<T>(keys: string[], fetchFn?: (missKeys: string[]) => Promise<Record<string, T> | Map<string, T>>, ttlSeconds?: number): Promise<(T | null)[]>;
|
|
283
290
|
/**
|
|
284
291
|
* Serializes active, unexpired L1 entries into a snapshot string (encrypted if WebCrypto encryption is enabled).
|
|
285
292
|
* Ideal for persisting Edge state to Cloudflare R2 before worker restart.
|