orpc-dedupe-requests-plugin
Prevents duplicate requests by deduplicating similar ones to reduce server load.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Prevents duplicate requests by deduplicating similar ones to reduce server load.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Dedupe Requests Plugin |
| description | Prevents duplicate requests by deduplicating similar ones to reduce server load. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
Prevents redundant requests by deduplicating similar ones.
import { DedupeRequestsPlugin } from '@orpc/client/plugins'
const link = new RPCLink({
plugins: [
new DedupeRequestsPlugin({
filter: ({ request }) => request.method === 'GET',
groups: [
{ condition: () => true, context: {} },
],
}),
],
})
By default, only
GETrequests are deduplicated.
A request must match at least one group. Requests in the same group are deduplicated together.
Example: dedupe based on cache control:
interface ClientContext { cache?: RequestCache }
const link = new RPCLink<ClientContext>({
url: 'http://localhost:3000/rpc',
method: ({ context }) => context?.cache ? 'GET' : 'POST',
plugins: [
new DedupeRequestsPlugin({
filter: ({ request }) => request.method === 'GET',
groups: [
{
condition: ({ context }) => context?.cache === 'force-cache',
context: { cache: 'force-cache' },
},
{ condition: () => true, context: {} },
],
}),
],
fetch: (request, init, { context }) => globalThis.fetch(request, {
...init,
cache: context?.cache,
}),
})