rsnext/test/production/prerender-prefetch
JJ Kasper 923fdcd2c5
Update to not trigger revalidation during prefetch (#37201)
Continuation of https://github.com/vercel/next.js/pull/34498 this updates to send a `purpose: prefetch` header (related [w3c discussion](https://github.com/w3c/resource-hints/issues/74)) when prefetching data routes and then on the server we skip revalidating when this header is set. 

When a client-transition is actually made we send a background HEAD (non-blocking) request to the data route without the `purpose: prefetch` header which signals a revalidation should occur if the data is stale.  

This helps alleviate the number of revalidations occurring currently caused by prefetches as a path can be prefetched but not visited during a session so may not need to be revalidated yet. 

Fixes: https://github.com/vercel/next.js/issues/17758
x-ref: https://github.com/vercel/next.js/discussions/20521
x-ref: [slack thread](https://vercel.slack.com/archives/C031QM96T0A/p1645129445819139?thread_ts=1645124478.067049&cid=C031QM96T0A)
2022-05-29 23:05:23 +00:00
..
app/pages Update to not trigger revalidation during prefetch (#37201) 2022-05-29 23:05:23 +00:00
index.test.ts Update to not trigger revalidation during prefetch (#37201) 2022-05-29 23:05:23 +00:00