mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #433] [MERGED] perf(kv): local tag cache to reduce KV round-trips on cache hit #570
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#570
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/433
Author: @Divkix
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @james-elicx
Base:
main← Head:perf/kv-tag-batching📝 Commits (5)
24b27baperf(kv): add local in-memory tag cache to reduce KV round-trips94f07b7fix(test): guard fake timers with try/finally to prevent leaks50694d6fix(kv): address bonk review comments on local tag cache549a350chore: merge main, resolve conflict (ExecutionContextLike)6653e29refactor(kv): reuse cached timestamps in invalidation check loop📊 Changes
2 files changed (+311 additions, -13 deletions)
View changed files
📝
packages/vinext/src/cloudflare/kv-cache-handler.ts(+80 -13)📝
tests/kv-cache-handler.test.ts(+231 -0)📄 Description
Closes #439
Summary
Mapwith 5-second TTL toKVCacheHandlerthat caches tag invalidation timestampskv.get()calls for recently-seen tags — an entry with 20 tags no longer triggers 20 KV round-trips on every cache hit within the TTL windowrevalidateTag()updates the local cache immediately so invalidations are reflected without waiting for TTL expiryresetRequestCache()clears the local cache for per-request isolationTest plan
tests/kv-cache-handler.test.tscovering:get()revalidateTag()updates local cache (no KV GET for invalidated tags)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.