-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Add a self-hosted shared cache example #58000
Add a self-hosted shared cache example #58000
Conversation
You may want to wait for this #57953 before merging and update your PR when it has been merged |
Hi @Fredkiss3, thank you for pointing out PR #57953. I had it in mind and should have mentioned it earlier. It's reasonable to wait for this feature, especially if it will be included in the upcoming 14.1.0 release by the Next.js team. I'll keep an eye on that PR, and once it's merged, I'll update my PR accordingly. |
180ebdd
to
1e0c593
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this!
1e0c593
to
eaee86a
Compare
Went ahead and merged the improved self-hosting docs before this. Do you want to link back to the example in the updated docs in this PR? |
@leerob, do you mean I can add a link or/and some description for this example to the updated docs by myself? |
Yeah, I'm suggesting in this PR, maybe add a sentence to link back to this example in the "Deploying" documentation also inside of this repo. |
eaee86a
to
1554df1
Compare
- Rename the example to `cache-handler-redis` to make naming consistent with docs and future next.config.js option name. - Reorder the information in the docs to make it easier to follow. - Add the `cache-handler-redis` example to the docs. - Remove the misleading `cache` class field from the docs example.
1554df1
to
4e523bc
Compare
@leerob, please review the modifications I made in the documentation. |
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Thank you for this contribution!
What?
This pull request integrates the exemplary setup for a self-hosted Next.js application utilizing Redis as a shared cache storage. The solution supports caching at both the App and Pages routers in default and standalone modes, as well as partial pre-rendering, facilitated by the
@neshca/cache-handler
package. The package enables customizing cache handlers and replacing the default cache provided by Next.js seamlessly.Why?
The motivation behind this pull request is to provide an example demonstrating how Redis can be used as a shared cache in a self-hosted environment, thereby improving the scalability of hosting multiple instances of a Next.js application.