Skip to content
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

Docs: Add explanation why CacheHandler.revalidateTag never gets called using Pages Router #65736

Open
khiarahF opened this issue May 14, 2024 · 0 comments
Labels
Documentation Related to Next.js' official documentation.

Comments

@khiarahF
Copy link

khiarahF commented May 14, 2024

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:

  • get
  • set
  • revalidateTag

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.get which returns no cache value
  • then getStaticProps gets called
  • lastly CacheHandler.set gets 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

@khiarahF khiarahF added the Documentation Related to Next.js' official documentation. label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

No branches or pull requests

1 participant