force revalidation for a app directory route.
Unanswered
Spectacled bear posted this in #help-forum
Spectacled bearOP
Hi, I have a pretty simple app which I am using to test out server components, and I need this simple behaviour:
1. user goes to a 'collection' route and sees their collection.
2. user goes to a 'search' route and adds another game to their collection.
3. user navigates back to the collection route, and the page refetches from the database (I am using prisma) such that the updated data is displayed.
Currently, the user does not see any update to the collection page when returning to this route.
This seems like a simple, normal use case, but I cannot achieve this. I have added
Thanks in advance
1. user goes to a 'collection' route and sees their collection.
2. user goes to a 'search' route and adds another game to their collection.
3. user navigates back to the collection route, and the page refetches from the database (I am using prisma) such that the updated data is displayed.
Currently, the user does not see any update to the collection page when returning to this route.
This seems like a simple, normal use case, but I cannot achieve this. I have added
export const revalidate = 0; to the end of the collection page, but it seems to have no effect. A page refresh seems to work though. I sure there must be some way to force react or next to re-render the page when the url is returned to though without a full browser refresh. Thanks in advance