tricache 1.0.2 → 2.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/README.md +78 -90
- package/dashboards/tricache-alerts.yaml +80 -4
- package/dashboards/tricache-grafana.json +54 -1
- package/dashboards/tricache-inventory.rules.yml +21 -0
- package/dist/{cache-service-CWI4jkS7.d.cts → cache-service-BV5T8-20.d.cts} +122 -21
- package/dist/cache-service-UZXOQGEY.js +14 -0
- package/dist/{cache-service-B108FzER.d.ts → cache-service-tpyrXvlH.d.ts} +122 -21
- package/dist/{chunk-UBWLPKTI.js → chunk-EJXG7WO6.js} +152 -32
- package/dist/{chunk-H4GFLQ26.js → chunk-KV7KISK2.js} +47 -1
- package/dist/{chunk-WYF7NOAT.js → chunk-MB3DMVWN.js} +2111 -543
- package/dist/{chunk-OYDU3SMI.js → chunk-RBJRTGFK.js} +5 -0
- package/dist/chunk-S5N65I45.js +17 -0
- package/dist/cli.cjs +2454 -572
- package/dist/cli.js +186 -11
- package/dist/dashboard/index.d.cts +2 -2
- package/dist/dashboard/index.d.ts +2 -2
- package/dist/drizzle/index.cjs +2335 -571
- package/dist/drizzle/index.d.cts +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +6 -2
- package/dist/edge/index.cjs +145 -43
- package/dist/edge/index.d.cts +11 -4
- package/dist/edge/index.d.ts +11 -4
- package/dist/edge/index.js +118 -43
- package/dist/hono/index.cjs +2322 -569
- package/dist/hono/index.d.cts +2 -2
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/index.js +2 -2
- package/dist/{hono-C886ok3X.d.cts → hono-CMv2VdQ6.d.cts} +18 -5
- package/dist/{hono-3rDMYVtY.d.ts → hono-Dvq04kX9.d.ts} +18 -5
- package/dist/http/index.cjs +2323 -570
- package/dist/http/index.d.cts +3 -3
- package/dist/http/index.d.ts +3 -3
- package/dist/http/index.js +4 -4
- package/dist/index.cjs +2554 -620
- package/dist/index.d.cts +88 -23
- package/dist/index.d.ts +88 -23
- package/dist/index.js +873 -16
- package/dist/{murmur3-CMGw9PbV.d.cts → murmur3-DF8BFRnu.d.cts} +1 -0
- package/dist/{murmur3-CMGw9PbV.d.ts → murmur3-DF8BFRnu.d.ts} +1 -0
- package/dist/nestjs/index.cjs +2292 -574
- package/dist/nestjs/index.d.cts +19 -5
- package/dist/nestjs/index.d.ts +19 -5
- package/dist/nestjs/index.js +25 -19
- package/dist/next/index.cjs +2306 -571
- package/dist/next/index.d.cts +8 -2
- package/dist/next/index.d.ts +8 -2
- package/dist/next/index.js +36 -9
- package/dist/prisma/index.cjs +26 -25
- package/dist/prisma/index.d.cts +2 -2
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +14 -25
- package/dist/serialize-worker.cjs +162 -39
- package/dist/serialize-worker.js +9 -7
- package/dist/{types-BA4pz1A0.d.cts → types-F8vRWMrE.d.cts} +162 -45
- package/dist/{types-BA4pz1A0.d.ts → types-F8vRWMrE.d.ts} +162 -45
- package/package.json +21 -2
- package/src/adapters/auto-pipeliner.ts +52 -11
- package/src/cache-service.ts +1537 -415
- package/src/cli.ts +2 -9
- package/src/codec.ts +3 -3
- package/src/compression.ts +39 -16
- package/src/cross-region.ts +1 -1
- package/src/disk-tier.ts +283 -43
- package/src/drizzle/index.ts +2 -1
- package/src/edge/adapters/cloudflare-do.ts +25 -10
- package/src/edge/adapters/cloudflare-kv.ts +12 -9
- package/src/edge/adapters/upstash.ts +27 -11
- package/src/edge/cache.ts +59 -17
- package/src/edge/types.ts +15 -5
- package/src/encryption.ts +50 -18
- package/src/env.d.ts +1 -1
- package/src/errors.ts +12 -0
- package/src/http/utils.ts +6 -0
- package/src/index.ts +6 -0
- package/src/latency-watchdog.ts +5 -1
- package/src/nestjs/decorators.ts +11 -6
- package/src/nestjs/tricache.module.ts +2 -1
- package/src/nestjs/tricache.store.ts +21 -9
- package/src/nestjs/types.ts +1 -1
- package/src/next/cache-handler.ts +24 -4
- package/src/next/types.ts +4 -0
- package/src/origin-capacity.ts +134 -0
- package/src/prisma/index.ts +14 -32
- package/src/remote-snapshot.ts +37 -27
- package/src/serialize-worker.ts +8 -5
- package/src/sigv4-snapshot-adapter.ts +37 -27
- package/src/smart-memory-cache.ts +62 -22
- package/src/types.ts +92 -35
- package/src/utils/config-comparison.ts +29 -0
- package/src/utils/lz4-size.ts +74 -0
- package/src/utils/namespace-key.ts +48 -0
- package/src/utils/query-key.ts +13 -0
- package/src/utils/snapshot-transfer.ts +83 -0
- package/src/utils/work-limits.ts +73 -0
- package/src/utils/write-revision.ts +4 -0
- package/src/wasm/bloom-filter-wasm.ts +16 -1
- package/src/worker-pool.ts +28 -8
- package/src/wtiny-lfu.ts +62 -14
- package/dist/cache-service-GYPZFB7O.js +0 -12
- package/dist/chunk-VNRDL5RA.js +0 -666
package/dist/http/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { K as KeyDerivationOptions } from '../utils-Bvzn-rKS.cjs';
|
|
2
2
|
export { b as buildDeterministicKey, g as generateETag, s as shouldSkipCache } from '../utils-Bvzn-rKS.cjs';
|
|
3
|
-
import { C as CacheService } from '../cache-service-
|
|
4
|
-
import { W as WrapOptions } from '../types-
|
|
5
|
-
export { C as CachedEdgeHttpResponse, H as HonoEdgeCacheOptions, b as buildEdgeDeterministicKey, c as computeEdgeETag, h as honoCache } from '../hono-
|
|
3
|
+
import { C as CacheService } from '../cache-service-BV5T8-20.cjs';
|
|
4
|
+
import { W as WrapOptions } from '../types-F8vRWMrE.cjs';
|
|
5
|
+
export { C as CachedEdgeHttpResponse, H as HonoEdgeCacheOptions, b as buildEdgeDeterministicKey, c as computeEdgeETag, h as honoCache } from '../hono-CMv2VdQ6.cjs';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
|
|
8
8
|
interface ExpressCacheOptions extends Omit<WrapOptions, 'tags'>, KeyDerivationOptions {
|
package/dist/http/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { K as KeyDerivationOptions } from '../utils-Bvzn-rKS.js';
|
|
2
2
|
export { b as buildDeterministicKey, g as generateETag, s as shouldSkipCache } from '../utils-Bvzn-rKS.js';
|
|
3
|
-
import { C as CacheService } from '../cache-service-
|
|
4
|
-
import { W as WrapOptions } from '../types-
|
|
5
|
-
export { C as CachedEdgeHttpResponse, H as HonoEdgeCacheOptions, b as buildEdgeDeterministicKey, c as computeEdgeETag, h as honoCache } from '../hono-
|
|
3
|
+
import { C as CacheService } from '../cache-service-tpyrXvlH.js';
|
|
4
|
+
import { W as WrapOptions } from '../types-F8vRWMrE.js';
|
|
5
|
+
export { C as CachedEdgeHttpResponse, H as HonoEdgeCacheOptions, b as buildEdgeDeterministicKey, c as computeEdgeETag, h as honoCache } from '../hono-Dvq04kX9.js';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
|
|
8
8
|
interface ExpressCacheOptions extends Omit<WrapOptions, 'tags'>, KeyDerivationOptions {
|
package/dist/http/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isShareableHttpResponse,
|
|
11
11
|
matchesETag,
|
|
12
12
|
shouldSkipCache
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-RBJRTGFK.js";
|
|
14
14
|
|
|
15
15
|
// src/http/express.ts
|
|
16
16
|
var UncacheableHttpResponse = class extends Error {
|
|
@@ -42,7 +42,7 @@ function createExpressMiddleware(options = {}) {
|
|
|
42
42
|
}
|
|
43
43
|
let activeCache = cache;
|
|
44
44
|
if (!activeCache) {
|
|
45
|
-
const { CacheService } = await import("../cache-service-
|
|
45
|
+
const { CacheService } = await import("../cache-service-UZXOQGEY.js");
|
|
46
46
|
activeCache = CacheService.create();
|
|
47
47
|
}
|
|
48
48
|
const keyOptions = { keyGenerator, headerWhitelist, cacheAuthenticated };
|
|
@@ -214,7 +214,7 @@ function createFastifyPlugin(options = {}) {
|
|
|
214
214
|
const ttl = mergedOpts.ttl ?? 300;
|
|
215
215
|
let activeCache = mergedOpts.cache;
|
|
216
216
|
if (!activeCache) {
|
|
217
|
-
const { CacheService } = await import("../cache-service-
|
|
217
|
+
const { CacheService } = await import("../cache-service-UZXOQGEY.js");
|
|
218
218
|
activeCache = CacheService.create();
|
|
219
219
|
}
|
|
220
220
|
fastify.addHook("onRequest", async (req, reply) => {
|
|
@@ -299,7 +299,7 @@ function fastifyCache(options = {}) {
|
|
|
299
299
|
if (shouldSkipCache(req, options.skipCache, options)) return;
|
|
300
300
|
let activeCache = options.cache;
|
|
301
301
|
if (!activeCache) {
|
|
302
|
-
const { CacheService } = await import("../cache-service-
|
|
302
|
+
const { CacheService } = await import("../cache-service-UZXOQGEY.js");
|
|
303
303
|
activeCache = CacheService.create();
|
|
304
304
|
}
|
|
305
305
|
const key = buildDeterministicKey(req, {
|