vercel/next.js

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

khiarahF opened this issue · 0 comments

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