mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #552] [MERGED] feat: implement revalidateByPathPrefix on KVCacheHandler #667
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#667
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/552
Author: @NathanDrake2406
Created: 3/15/2026
Status: ✅ Merged
Merged: 3/16/2026
Merged by: @james-elicx
Base:
main← Head:feat/kv-revalidate-by-path-prefix📝 Commits (3)
2fc3435feat: implement revalidateByPathPrefix on KVCacheHandlerc21d258fix: guard against KV metadata 1024-byte limitd381ef0test: add regression test for KV metadata 1024-byte overflow📊 Changes
2 files changed (+246 additions, -5 deletions)
View changed files
📝
packages/vinext/src/cloudflare/kv-cache-handler.ts(+73 -1)📝
tests/kv-cache-handler.test.ts(+173 -4)📄 Description
Summary
Follow-up to #544 — implements
revalidateByPathPrefixonKVCacheHandlersorevalidatePath('/dashboard', 'layout')works on Cloudflare Workers production (not just the dev-modeMemoryCacheHandler).Key design choice: Uses KV list metadata instead of fetching every entry's JSON body.
set()now stores tags in KV metadata (kv.put(key, value, { metadata: { tags } }))revalidateByPathPrefix()callskv.list()which returns metadata inline with each key — zero extrakv.get()callsisPathChildOf()—/dashboarddoes NOT match/dashboard-adminTest plan
/dashboarddoes not match/dashboard-admin/prefix invalidates all path-tagged entries🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.