Next.js Discord

Discord Forum

Strange revalidation behaviour

Answered
Turkish Van posted this in #help-forum
Open in Discord
Turkish VanOP
I am having a simple blog app that serves a 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 user

The 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.
View full answer

1 Reply

Looks like https://github.com/vercel/next.js/issues/58736. This is a known issue.
Answer