Skip to content

feat(storage): add purge_cache and purge_bucket_cache canonical capabilities#44

Open
grdsdev wants to merge 5 commits into
mainfrom
claude/unruffled-ramanujan-912c1c
Open

feat(storage): add purge_cache and purge_bucket_cache canonical capabilities#44
grdsdev wants to merge 5 commits into
mainfrom
claude/unruffled-ramanujan-912c1c

Conversation

@grdsdev

@grdsdev grdsdev commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds storage.file_buckets.purge_cache — invalidate CDN cache for a specific object in a bucket (StorageFileApi.purgeCache(path))
  • Adds storage.file_buckets.purge_bucket_cache — invalidate CDN cache for all objects in a bucket (StorageBucketApi.purgeBucketCache())

Why

These capabilities were introduced in supabase/supabase-js#2429 and are now registered here as canonical features so SDK compliance files can reference them.

Notes for reviewers

  • Both features require a service_role JWT — anon/user JWT calls are rejected by the storage server.
  • Both require the purgeCache tenant feature to be enabled (self-hosted deployments also need CDN_PURGE_ENDPOINT_URL configured).
  • These are placed in the file_buckets group, consistent with the other file-level operations.
  • Validation (npm run validate) and the full test suite (125 tests) pass with no changes.

Registers two new canonical storage capabilities sourced from
supabase/supabase-js#2429:

- storage.file_buckets.purge_cache — invalidate CDN cache for a single
  object via StorageFileApi.purgeCache(path)
- storage.file_buckets.purge_bucket_cache — invalidate CDN cache for an
  entire bucket via StorageBucketApi.purgeBucketCache()

Both require a service_role JWT and the purgeCache tenant feature.
@grdsdev grdsdev requested a review from a team as a code owner June 25, 2026 12:41
Adds human-readable specs for the two new CDN cache purge capabilities:

- specs/storage/file_buckets/purge_cache.md
- specs/storage/file_buckets/purge_bucket_cache.md

Covers the HTTP endpoint, behavioral contract, service_role requirement,
purgeCache tenant feature prerequisite, error conditions, and cross-links.

@QuintinWillison QuintinWillison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice to see capabilities being added, resulting in a much smaller PR diff, much easier on the eyes for the human reviewers! 💪 ... just a couple of thoughts/questions...

Comment thread capabilities/storage.yaml Outdated
@grdsdev grdsdev requested a review from QuintinWillison June 25, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants