Skip to content
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

feat: basic in-memory de-duping revalidation queue #360

Merged
merged 11 commits into from
Feb 12, 2025

Conversation

james-elicx
Copy link
Collaborator

@james-elicx james-elicx commented Feb 9, 2025

Super basic de-duping on a per-isolate basis for the queue.

This approach uses the MessageGroupId for the de-duping key as it is based on just the path, and the key for ISR pages in the incremental cache is also the path, so we can compute the correct key to free from the list of revalidated paths.

Copy link

changeset-bot bot commented Feb 9, 2025

🦋 Changeset detected

Latest commit: e134601

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 Feb 9, 2025

Open in Stackblitz

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

commit: e134601

@james-elicx james-elicx marked this pull request as ready for review February 9, 2025 18:51
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

I took a quick look but I'm not sure to understand how dedup works here.

Can you add some tests?

Thanks

@james-elicx
Copy link
Collaborator Author

I took a quick look but I'm not sure to understand how dedup works here.

Can you add some tests?

Thanks

I made a super dumb mistake last night and forgot to actually check if a revalidation was in progress 😅. Obviously immediately visible when adding tests.

@james-elicx james-elicx requested a review from vicb February 11, 2025 19:19
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

LGTM.

I added some comments but this looks good to go.

Thanks for your work on this and sorry for the review delay.

@james-elicx james-elicx merged commit 82bb588 into main Feb 12, 2025
7 checks passed
@james-elicx james-elicx deleted the james/memory-queue branch February 12, 2025 08:14
@james-elicx
Copy link
Collaborator Author

Docs PR - opennextjs/docs#74

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