Support on-demand purge nextjs cache released in 12.1
See original GitHub issueIs your feature request related to a problem? Please describe. Without the mechanism to purge the nextjs cache, it is a pitfall in production use and causing a lot of problems.
Describe the solution you’d like
Support the res.unstable_revalidate
in api which can be controlled by backend to purge the cache and regenerate the page requested. It is supported in Nextjs 12.1, and it will be great if we can support it as well:
https://nextjs.org/blog/next-12-1
Describe alternatives you’ve considered Disable the next.js cache totally. To be tested. Using CDN Cache instead with a purge api call.
Additional context An example is in this video: https://www.youtube.com/watch?v=BGexHR1tuOA&t=16s
Issue Analytics
- State:
- Created a year ago
- Reactions:11
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Blog - Next.js 12.1
You can now manually purge the Next.js cache for a specific page on-demand. This makes it easier to update your site when: Content...
Read more >How to clear/delete cache in NextJs? - Stack Overflow
I think this is possible starting from next@12.1.x using this feature On-demand Incremental Static Regeneration ...
Read more >Tim on Twitter: "Image optimization now automatically uses ...
Next.js 12.1 : ◇ On-demand Incremental Static Regeneration ◇ SWC support ... Image optimization now automatically uses the same cache as "revalidate" in ......
Read more >Question - timeline to support on-demand Incremental Static ...
Next 12.1.0 was released in the last few days and it provides support for On-demand Incremental Static Regeneration (ISR): Blog - Next.js ......
Read more >Incremental Static Regeneration with Next.js - LogRocket Blog
Next.js v9.5 introduced a new strategy called Incremental Static ... In Next.js 12, we have another feature called on-demand ISR, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the error I get when I tried to call
res.unstable_revalidate
Error: Failed to revalidate /: Invariant: required internal revalidate method not passed to api-utils
I was able to trigger regeneration. Feel free to adapt this code to your needs until we get some better official approach.