Skip to content

feat: add ability to purge cdn for whole buckets, tenant, and transformations#1133

Open
itslenny wants to merge 6 commits into
masterfrom
lenny/add-manual-cache-purge
Open

feat: add ability to purge cdn for whole buckets, tenant, and transformations#1133
itslenny wants to merge 6 commits into
masterfrom
lenny/add-manual-cache-purge

Conversation

@itslenny

@itslenny itslenny commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature

What is the current behavior?

The CDN can only be purged for individual objects using the full object path.

There is no way to specifically purge transformations

What is the new behavior?

CDN can be purged for individual objects or all objects in an entire bucket or entire tenant.

Also, supports purging just the transformations at all three levels.

Endpoints

  • DELETE /storage/v1/cdn/bucket-name/path/to/an/object.ext - Existing purge endpoint, purges single cached object
  • DELETE /storage/v1/cdn/bucket-name/path/to/an/object.ext?transformations=true - Purge all cached transformations for a single object
  • DELETE /storage/v1/cdn/bucket-name - Purge all cached objects in specified bucket
  • DELETE /storage/v1/cdn/bucket-name?transformations=true - Purge all cached transformations associated with objects in specified bucket
  • DELETE /storage/v1/cdn - Purge all cached objects for this tenant
  • DELETE /storage/v1/cdn?transformations=true - Purge all cached transformations for this tenant

Additional context

Requires deploy of updated CDN cache manager worker

@itslenny itslenny requested a review from a team as a code owner June 3, 2026 23:03
@itslenny itslenny force-pushed the lenny/add-manual-cache-purge branch from 37b582d to 095a621 Compare June 4, 2026 12:53
@coveralls

coveralls commented Jun 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27632369399

Coverage increased (+0.06%) to 78.383%

Details

  • Coverage increased (+0.06%) from the base build.
  • Patch coverage: 18 of 18 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11898
Covered Lines: 9782
Line Coverage: 82.22%
Relevant Branches: 6823
Covered Branches: 4892
Branch Coverage: 71.7%
Branches in Coverage %: Yes
Coverage Strength: 432.76 hits per line

💛 - Coveralls

Comment thread src/storage/cdn/cdn-cache-manager.ts
Comment thread src/storage/cdn/cdn-cache-manager.ts Outdated
Comment thread src/storage/cdn/cdn-cache-manager.ts Outdated
Comment thread src/test/cdn.test.ts
Comment thread src/http/routes/cdn/purgeCache.ts
@itslenny itslenny force-pushed the lenny/add-manual-cache-purge branch 2 times, most recently from 5ce73c0 to 058986f Compare June 9, 2026 18:05
@itslenny itslenny requested a review from ferhatelmas June 9, 2026 18:23
Comment thread acceptance/specs/cdn-render.test.ts Outdated
Comment thread src/test/cdn.test.ts
@itslenny itslenny requested a review from ferhatelmas June 11, 2026 22:49
@itslenny itslenny force-pushed the lenny/add-manual-cache-purge branch from c2a8f1d to fd9f6c0 Compare June 15, 2026 13:37
Comment thread src/test/cdn.test.ts Outdated
@ferhatelmas

Copy link
Copy Markdown
Member

Acceptance CDN stub is ignoring body shape at the moment. It didn't matter much previously since there was one shape but we might want to add validation. It also creates some coupling with another implementation and we already do in integration tests so feel free to ignore

@itslenny itslenny requested a review from ferhatelmas June 16, 2026 15:23
Comment thread src/storage/cdn/cdn-cache-manager.ts Outdated
@itslenny itslenny force-pushed the lenny/add-manual-cache-purge branch from 84483cb to e0aca8a Compare June 16, 2026 16:24
@itslenny itslenny force-pushed the lenny/add-manual-cache-purge branch from e0aca8a to 543fecd Compare June 16, 2026 16:26
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.

3 participants