next.js
c5678959 - [segment cache]: delay revalidation prefetch pings 300ms (#84981)

Commit
97 days ago
[segment cache]: delay revalidation prefetch pings 300ms (#84981) After performing a router revalidation (ie in a server action, or calling router.refresh()), we currently immediately re-prefetch any links on the page to ensure that subsequent navigations will be able to see any changed data. This generally works fine when self-hosting/via `next start` because the same server that is responsible for writing to the cache also handles serving it. However, when Next.js deployed and fronted by an external cache handler/CDN (eg deployed to Vercel), it can take some time to propagate. On Vercel, the documented max amount of time is 300ms. To alleviate stale data that could come about as a result of this, we will wait 300ms before triggering the prefetch again.
Author
Parents
Loading