Skip to content

feat(storage): add purgeBucketCache to invalidate CDN cache for a whole bucket#1608

Merged
spydon merged 1 commit into
worktree-sdk-1331from
worktree-sdk-1332
Jul 17, 2026
Merged

feat(storage): add purgeBucketCache to invalidate CDN cache for a whole bucket#1608
spydon merged 1 commit into
worktree-sdk-1331from
worktree-sdk-1332

Conversation

@spydon

@spydon spydon commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds StorageBucketApi.purgeBucketCache(id, {transformations}) to invalidate the CDN cache for every object in a bucket. Issues DELETE /cdn/{bucket} against the storage base URL and returns the server's success message. When transformations is true, only the resized/formatted variants are purged, leaving the original cached objects intact; otherwise the bucket cache is purged.

Requires the service-role key and the tenant purgeCache feature enabled on the storage server.

Stacked on top of #1607 (SDK-1331, object-level purge). Base this PR against main once #1607 merges.

Outcome: implemented

Reference: supabase-js PR #2429 (storage.file_buckets.purge_bucket_cache)

Compliance matrix

  • storage.file_buckets.purge_bucket_cacheimplemented (symbol StorageBucketApi.purgeBucketCache)

Tests

Added unit tests in packages/storage_client/test/basic_test.dart covering the DELETE endpoint/URL and the transformations query parameter.

SDK-1332

@spydon
spydon requested a review from a team as a code owner July 16, 2026 16:33
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 886e5882-bbd0-44ae-9203-78029ada56bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the storage This issue or pull request is related to storage label Jul 16, 2026
@spydon
spydon merged commit 46eb0ab into worktree-sdk-1331 Jul 17, 2026
28 checks passed
@spydon
spydon deleted the worktree-sdk-1332 branch July 17, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage This issue or pull request is related to storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants