next.js
b01bb6c7 - Craigandrews/ensure isr lru is written if requests collapsed (#93766)

Commit
63 days ago
Craigandrews/ensure isr lru is written if requests collapsed (#93766) Adopted from: #93699 ## Summary When multiple ISR revalidation invocations (different `x-invocation-id`) arrive concurrently for the same path, the Batcher correctly deduplicates them into a single render. The LRU is only written inside `handleRevalidate`, and only the winning invocation executes this code. Batched invocations return the shared promise directly and never write to the LRU. Their follow-up requests miss the LRU and trigger a new render, cascading under load. Moved the minimal mode LRU write from `handleRevalidate` to `get()`, after the Batcher resolves. Every caller now writes to the LRU under its own invocation key, so follow-up requests always find a cache entry. ## Test Plan - Unit test: concurrent invocations with different `invocationID` values verify only one render executes and follow-up requests hit the LRU --------- Co-authored-by: Craig Andrews <craig.andrews@vercel.com>
Author
Parents
Loading