Skip to content

Conversation

james-elicx
Copy link
Collaborator

  • Adds info about the __OPENNEXT_KV_BINDING_NAME env var.
  • Defers the caching part of the get started to the caching docs, since one is just copy-paste of the other.
  • Fix a broken code block and broken link.

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 added a suggestion, feel free to discard if you don't think it adds value.
Thanks!


#### 2. Add the KV namespace to your Worker

The binding name used in your app's worker will be `NEXT_CACHE_WORKERS_KV` by default. This is configurable and can be changed by setting the `__OPENNEXT_KV_BINDING_NAME` build-time environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

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

What about re-using <YOUR_NAMESPACE_NAME> and add a note about the default value at the bottom of this section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the binding name can differ from the namespace name (and maybe should if you have multiple next.js apps or preview vs prod), so i'm not sure that would be the right recommendation

Copy link
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Great stuff 😄 🚀

@james-elicx james-elicx merged commit c87cb62 into opennextjs:main Oct 12, 2024
1 check passed
@james-elicx james-elicx deleted the james/kv-cache-name-env-var branch October 12, 2024 21:31
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