Skip to content

[FEATURE] Using KV for caching is a bit expensive. Could we add a solution that uses D1? #405

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
2 tasks done
j4tmr opened this issue Feb 24, 2025 · 1 comment
Open
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@j4tmr
Copy link

j4tmr commented Feb 24, 2025

Is your feature request related to a problem?

Using KV for caching is a bit expensive. Could we add a solution that uses D1 instead, or perhaps implement a more complex configuration option? For example, selecting where the cache should be stored based on its tag.

Describe the solution you'd like

Describe alternatives you've considered

@opennextjs/cloudflare version

0.5.3

Additional context

No response

Before submitting

  • I have checked that there isn't already a similar feature request
  • This is a single feature (not multiple features in one request)
@j4tmr j4tmr added enhancement New feature or request triage labels Feb 24, 2025
@james-elicx
Copy link
Collaborator

Thanks for the issue.

We're going to look at adding an R2 option for the incremental cache.

D1 is an interesting one as there's a row size limit of 2mb, much lower than KV's 25mb limit for values, and so i can imagine that there potentially might be apps that have insanely large pages that could exceed that limit.

Having said that though, it will likely be added as an option at some point. My view is that we should support many different options, and leave it up to the users to decide which storage mechanism best works for their use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants