ISR deduping
Unanswered
Red-billed Pigeon posted this in #help-forum
Red-billed PigeonOP
Hello! Question about ISR which I couldn't find a clear answer to. If we have a page using ISR which is stale, and many requests are made for the same page at the same time, will the regeneration of the page be deduped or will each request cause a page regeneration?
17 Replies
Red-billed PigeonOP
Specifically for self hosted, not vercel
I think it should just return the old until new data is available
Let me confirm it, wait
@Red-billed Pigeon Hello! Question about ISR which I couldn't find a clear answer to. If we have a page using ISR which is stale, and many requests are made for the same page at the same time, will the regeneration of the page be deduped or will each request cause a page regeneration?
If you see this page: https://nextjs.org/docs/app/guides/incremental-static-regeneration
It looks like it'll still return the stale data, because step 5 says once generation is completed successfully
It looks like it'll still return the stale data, because step 5 says once generation is completed successfully
@Anay-208 | Ping in replies If you see this page: https://nextjs.org/docs/app/guides/incremental-static-regeneration
It looks like it'll still return the stale data, because step 5 says once generation is completed successfully
Red-billed PigeonOP
I understand that piece but the main question is if each request kicks off a regeneration
Say i have 1k requests per second, will NextJS be smart enough to dedup the regeneration
@Red-billed Pigeon Say i have 1k requests per second, will NextJS be smart enough to dedup the regeneration
Umm, that is something which might actually need to be tested, I'm not sure
Red-billed PigeonOP
yea we are seeing huge bursts of CPU usage and want to see if that’s the cause
@Red-billed Pigeon yea we are seeing huge bursts of CPU usage and want to see if that’s the cause
You can like add a console.log on revalidation to confimr
@Anay-208 | Ping in replies You can like add a console.log on revalidation to confimr
Red-billed PigeonOP
true, was just hoping this was a known thing
I'll try it out locally and create a issue if it actually executes multiple time
@Red-billed Pigeon So I tried it out on locally on latest version, and there was only 1 revalidation request
Red-billed PigeonOP
Im gonna try today, probably helps to add a delay inside of getStaticProps to simulate a long build time
also curious if it does dedup, if its possible to dedup across servers
Maybe next is using my configured cache handler (redis) to create a lock
Red-billed PigeonOP
But ok yes can confirm it will not duplicate revalidation across many requests