Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Sep 24, 2025

No description provided.

@vicb vicb requested a review from conico974 September 24, 2025 11:27
Copy link

changeset-bot bot commented Sep 24, 2025

🦋 Changeset detected

Latest commit: b27784b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@opennextjs/cloudflare Minor

Not sure what this means? Click here to learn what changesets are.

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

Copy link

pkg-pr-new bot commented Sep 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@906

commit: b27784b

Copy link
Collaborator

@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.

Just some small little change needed and a few thing maybe to add as comment

await kv.put(this.getCacheKey(tag), timeMs);
})
);
await purgeCacheByTags(tags);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is already done in aws, we should not do it again here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I guess it should be removed from D1 and DO too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how/where this is done in aws though?
Can you point to the code?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@vicb vicb Sep 24, 2025

Choose a reason for hiding this comment

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

Before checking the length, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see what you mean, we should implement a new method in the CDN invalidation.

So I guess this code is good to merge now (I'll add a TODO here and for D1 & DO).
(A follow-up I had was to only call purgeCacheByTags when there is a CDN invalidator so that we do not log errors when not).

I could create an issue in aws to add the method and reference it in this repo.

Do that sound good?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah perfect

@vicb
Copy link
Contributor Author

vicb commented Sep 25, 2025

Thanks for the review and feedback Nico!

@vicb vicb merged commit dcc864d into main Sep 25, 2025
7 checks passed
@vicb vicb deleted the vicb/tag-kv branch September 25, 2025 09:00
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