Docs: Add explanation why CacheHandler.revalidateTag never gets called using Pages Router
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
What is the update you wish to see?
Update the ISR documentation for Pages Router to explain what revalidate will actually do. Point out that CacheHandler.revalidateTag will never get called and does not need to be implemented. Fix the example that is showing revalidateTag having an implementation.
Is there any context that might help us understand?
The docs suggest that you can implement a custom CacheHandler with the following interface:
getsetrevalidateTag
This is suggested for both App and Page routers respectively using the exact same code.
I have tried a bunch of different setups and whatever I do revalidateTag never appears to be called.
What happens is the following:
- revalidate api endpoint gets called
- within the api endpoint
await response.revalidate(path)gets called - this triggers
CacheHandler.getwhich returns no cache value - then
getStaticPropsgets called - lastly
CacheHandler.setgets called to store the cache value
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/pages/building-your-application/deploying#caching-and-isr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Pages Router Caching and ISR documentation at the linked page and compare its custom CacheHandler example with the App Router version. Explain what revalidate does, clarify that CacheHandler.revalidateTag is not called for the Pages Router, and remove that implementation from the example. Done means the Pages Router guidance accurately distinguishes the two router behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100