Skip to content

Feat Automatic cache purge #655

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Feat Automatic cache purge #655

wants to merge 5 commits into from

Conversation

conico974
Copy link
Collaborator

This PR will allow to automatically purge Cache Api entry everywhere where we use them

Copy link

changeset-bot bot commented May 8, 2025

⚠️ No Changeset found

Latest commit: 149fcaa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

pkg-pr-new bot commented May 8, 2025

Open in StackBlitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@655

commit: 149fcaa

Comment on lines 59 to 60
CACHE_ZONE_ID?: string;
CACHE_API_TOKEN?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest: add documentation for each of the variable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, i'm still working on it.
I'm testing a few things especially around Cache purge limits https://developers.cloudflare.com/cache/how-to/purge-cache/#hostname-tag-prefix-url-and-purge-everything-limits
We could add a DO to handle these cases, i think the easiest way would be to just add a buffer DO.
Given how this is used, i think you'd need a custom solution anyway if you exceeds the provided req/s regularly.

@conico974 conico974 marked this pull request as ready for review May 9, 2025 14:27
Copy link
Collaborator Author

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

I'm not entirely sure about naming here. If you have better ideas

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