Strange revalidation behaviour
Answered
Turkish Van posted this in #help-forum
Turkish VanOP
I am having a simple blog app that serves a
Once
- post gets added to database
- data gets
- request for new data is being made to database
- new data, including the new post, gets served to the
The expected behaviour, once
But, once
And only then, every other hard refresh/revisit results in
Why isn't the firstly
cached data. Whenever user visits the app, there are no requests being made to database (excluding the auth ones).Once
user creates a new post:- post gets added to database
- data gets
revalidated by usage of revalidatePath() function- request for new data is being made to database
- new data, including the new post, gets served to the
userThe expected behaviour, once
user either hard refreshes or revisits the app, is the cached data to be served.But, once
user hard refreshes the app, AGAIN a new request for data is being made to database.And only then, every other hard refresh/revisit results in
cached data being served.Why isn't the firstly
revalidated data cached but only the second one made after a hard refresh?Answered by joulev
Looks like https://github.com/vercel/next.js/issues/58736. This is a known issue.
1 Reply
Looks like https://github.com/vercel/next.js/issues/58736. This is a known issue.
Answer