Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
260 changes: 242 additions & 18 deletions packages/3-extensions/middleware-cache/README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/3-extensions/middleware-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
},
"dependencies": {
"@prisma-next/framework-components": "workspace:0.14.0"
"@prisma-next/framework-components": "workspace:0.14.0",
"@prisma-next/utils": "workspace:0.14.0"
},
"devDependencies": {
"@prisma-next/contract": "workspace:0.14.0",
Expand Down
13 changes: 13 additions & 0 deletions packages/3-extensions/middleware-cache/src/cache-annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,24 @@ import { defineAnnotation } from '@prisma-next/framework-components/runtime';
* **not** rehash it, so the caller is responsible for ensuring the
* string is bounded in size and free of sensitive data they do not
* want flowing into logs / Redis `KEYS` / persistence dumps.
* - `dedupe` — Per-query toggle for in-process miss deduplication
* (single-flight). When `true`, concurrent identical misses for the
* same effective key in the same process share one leader execution;
* followers wait for the leader's result. When `false`, each miss
* executes independently.
* - `tags` — Optional list of cache tags to associate with this entry.
* Tags enable bulk cache invalidation: uncache by tag(s) will clear
* all entries that have those tags, regardless of key pattern.
*/
export interface CachePayload {
readonly enabled?: boolean;
readonly ttl?: number;
readonly skip?: boolean;
readonly key?: string;
readonly namespace?: string;
readonly dedupe?: boolean;
readonly tags?: readonly string[];
readonly store?: string;
}

/**
Expand Down
Loading