Repository navigation
feat: add opt-in cache invalidation via invalidate option - #26
Merged
Merged
Conversation
FetchifyMethodOptions gains invalidate?: boolean | (string | URL)[], honored on any HTTP method whenever a live ok response resolves on a client configured with cache: true purges the request's own GET cache entry, and an array purges each resolved entry. No automatic invalidation of any kind. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Syncs the delta specs from add-cache-invalidation-on-mutations into openspec/specs/: adds the cache-invalidation capability and updates cache-adapters' non-GET bypass requirement to describe the invalidate exception. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
test: Run #40
🎉 All tests passed!Github Test Reporter by CTRF 💚 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FetchifyMethodOptionsgains an optionalinvalidate?: boolean | (string | URL)[], honored on every HTTP method, not just mutating verbs.okresponse on a client configured withcache:invalidate: truedeletes theGETcache entry for that request's own resolved URL, and an array ofstring | URLentries resolves each one (same rules as request-path resolution) and deletes itsGETcache entry.invalidate(orfalse/[]) leaves cache behavior exactly as it was before this change. Each entry is invalidated independently, so aCacheAdapter.deletefailure for one never blocks the rest or affects the resolved response.add-cache-invalidation-on-mutationsfully implemented (27/27 tasks) and its delta specs synced intoopenspec/specs/(newcache-invalidationcapability, updatedcache-adapters).Test plan
bun test— 288 pass, 0 failbun run build— cleanbun run lint— cleanopenspec validate --changes/--specs— all pass🤖 Generated with Claude Code