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

RevalidateTag fails randomly on production #199

Open
valse opened this issue Feb 21, 2024 · 6 comments
Open

RevalidateTag fails randomly on production #199

valse opened this issue Feb 21, 2024 · 6 comments

Comments

@valse
Copy link

valse commented Feb 21, 2024

Hi, I'm facing same issues with the current revalidate setting on the loadQuery method because on production in a Vercel web app, revalidating by the webhook not all the pages with the desired tag are refreshed correctly.

Disabling the cache on the loadQuery revalidate property all works as expected.

Why you've chosen to enable the cache in this scenario?

Thanks!

@stipsan
Copy link
Member

stipsan commented Feb 22, 2024

Can you elaborate what you mean by works correctly?
If you refresh multiple times after the revalidateTag call is made does it eventually show the new content? Or is it "stuck" forever on some pages no matter what you do?

@valse
Copy link
Author

valse commented Feb 23, 2024

Hi, exactly the second one: if you have for example 2 pages with the same tag sometimes the revalidate purge both, sometimes only one or none of them.
Keeping the revalidate like this:

let revalidate: NextFetchRequestConfig['revalidate'] = 0

It works as expected refreshing always all the contents.

@valse
Copy link
Author

valse commented Feb 24, 2024

I just realized that disabling the cache setting the revalidate to 0 is like having a dynamic page that queries sanity for each requests 🤦🏼‍♂️

I saw that it's a bug using the generateStaticParams feature: avoiding it but using the cache, setting the revalidate properties to false, the page caches the calls to sanity until the next revalidateTag request.

@nikolailehbrink
Copy link

Hi @valse, I have exactly the same problem that when I update a project from the starter template, the preview for the project on the home page is revalidated but not the individual project page. This is related to the problem you linked and the only thing to do is to wait until the next team has found a solution, correct?

@valse
Copy link
Author

valse commented Apr 16, 2024

Hi @nikolailehbrink... yes for the moment the problem still exists but I found a workaround that not prerender the pages on build but it cache the requests and revalidate them.

@nikolailehbrink
Copy link

Oh wow! 😄 Okay, I will look into it! Thank you @valse!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants