Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Purge cache for specific objects #650

Merged
merged 1 commit into from
Apr 4, 2025
Merged

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Apr 2, 2025

What kind of change does this PR introduce?

Feature

What is the current behavior?

Currently is not possible to purge the cache programmatically

What is the new behavior?

This PR introduces a new endpoint: DELETE /cdn/{bucket}/{object} that allows purging the cache for a specific object

Additional context

The actual implementation for purging the cache sits outside of storage, this is because we don't want to couple the service
to a specific purge mechanism.

Storage invokes an external HTTP endpoint, which does the purging to keep it agnostic

Copy link

snyk-io bot commented Apr 2, 2025

Snyk checks have failed. 2 issues have been found so far.

Icon Severity Issues
Critical 0
High 0
Medium 2
Low 0

code/snyk check is complete. 2 issues have been found. (View Details)

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@fenos fenos force-pushed the feat/purge-cache-for-object branch 4 times, most recently from 15c42e0 to 2c01e2c Compare April 2, 2025 11:32
@coveralls
Copy link

coveralls commented Apr 2, 2025

Pull Request Test Coverage Report for Build 14262662188

Details

  • 165 of 177 (93.22%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 76.626%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/internal/database/tenant.ts 3 7 42.86%
src/storage/cdn/cdn-cache-manager.ts 52 60 86.67%
Totals Coverage Status
Change from base Build 13789562193: 0.1%
Covered Lines: 15596
Relevant Lines: 20200

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14218413363

Details

  • 142 of 150 (94.67%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 76.618%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/storage/cdn/cdn-cache-manager.ts 54 62 87.1%
Totals Coverage Status
Change from base Build 13789562193: 0.1%
Covered Lines: 15573
Relevant Lines: 20173

💛 - Coveralls

Copy link
Contributor

@itslenny itslenny left a comment

Choose a reason for hiding this comment

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

Looks good to me. Maybe resolve those eslint warnings.

edit: I saw the warnings in "files changed" tab, but didn't realize this wasn't actually part of the change. Removing (e: any) if it's not going to be used should resolve both warnings (config.ts:462).

@fenos fenos force-pushed the feat/purge-cache-for-object branch 3 times, most recently from e0f8d9d to a03cfaa Compare April 3, 2025 10:56
@fenos fenos force-pushed the feat/purge-cache-for-object branch from a03cfaa to 1a32426 Compare April 4, 2025 09:47
@fenos fenos merged commit 954644b into master Apr 4, 2025
1 of 2 checks passed
@fenos fenos deleted the feat/purge-cache-for-object branch April 4, 2025 10:01
Copy link

github-actions bot commented Apr 4, 2025

🎉 This PR is included in version 1.20.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants