Skip to content

Conversation

james-elicx
Copy link
Collaborator

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

This PR is based off of #436 to enable auto-populating of the cache entries.

Changes

  • Adds a new R2 adapter for the incremental cache.
  • Caches entries using the Cache API, and updates the Cache API in the background when an R2 fetch completes.
  • Adds support for populating the R2 bucket during build.
  • Enables the R2 adapter in the app-router e2es.

Discussion points

  • We might need to duplicate the app-router tests for each adapter we add so that we can run them for multiple adapters. Or change how the e2es are run to support being run multiple times with different adapters.

This is part 2 of 3 in a stack made with GitButler:

Copy link

changeset-bot bot commented Mar 9, 2025

🦋 Changeset detected

Latest commit: 33c238b

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 Patch

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

@james-elicx james-elicx changed the title feat: auto-populating d1 cache data feat: r2 adapter for the incremental cache Mar 9, 2025
Copy link

pkg-pr-new bot commented Mar 9, 2025

Open in Stackblitz

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

commit: 33c238b

@james-elicx james-elicx marked this pull request as ready for review March 9, 2025 00:38
@james-elicx james-elicx marked this pull request as ready for review March 13, 2025 20:53
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 one little comment, i guess the only thing remaining is what to do for #436

@james-elicx
Copy link
Collaborator Author

Just one little comment, i guess the only thing remaining is what to do for #436

Yeah I think the main outstanding questions are;

  • Default to local population vs explicitly opt in for population.
  • Consider having multiple commands for the adapter instead where the population is based on the command.

I was hoping to be able to talk about those this week, but didn't realise that the meeting time was changing 😓. Hopefully Victor might have a chance to take a look at the PRs at some point, otherwise we can discuss next week I guess, but I was hoping to have wrapped up the population one by now.

Base automatically changed from james/populate-cache to main March 20, 2025 21:56
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 with a few nits

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.

LGTM, just a small comment

@james-elicx james-elicx merged commit 54508ff into main Mar 21, 2025
7 checks passed
@james-elicx james-elicx deleted the james/r2 branch March 21, 2025 11:06
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