-
Notifications
You must be signed in to change notification settings - Fork 30k
docs: improve unstable_cache documentation with clearer example #86343
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
base: canary
Are you sure you want to change the base?
docs: improve unstable_cache documentation with clearer example #86343
Conversation
|
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.
Pull Request Overview
This PR simplifies the unstable_cache documentation by replacing a complex example that involved params handling with a more straightforward "Get Posts" scenario using mock data.
- Removed the params-based user fetching example
- Added a simpler posts list example with mock data that clearly demonstrates the caching mechanism
- Improved code consistency between TypeScript and JavaScript examples
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Happy to refine the example if you prefer a different structure, naming, or level of detail. |
03b17a6 to
d10ed21
Compare
What?
I updated the example in the
unstable_cachedocumentation to be simpler and more focused.Why?
The previous example was a bit complex as it mixed
paramshandling with the caching logic. It wasn't immediately clear for beginners howunstable_cacheworks in isolation.How?
I replaced the example with a straightforward "Get Posts" scenario that uses mock data. This demonstrates the caching mechanism clearly without the distraction of other Next.js features.