File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/runtime/src/templates Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const getNetlifyNextServer = (NextServer: NextServerType) => {
42
42
// conditionally use the prebundled React module
43
43
this . netlifyPrebundleReact ( url )
44
44
45
- // intercept on-demand revalidation requests and handler with the Netlify API
45
+ // intercept on-demand revalidation requests and handle with the Netlify API
46
46
if ( headers [ 'x-prerender-revalidate' ] && this . netlifyConfig . revalidateToken ) {
47
47
// handle on-demand revalidation by purging the ODB cache
48
48
await this . netlifyRevalidate ( url )
@@ -54,10 +54,11 @@ const getNetlifyNextServer = (NextServer: NextServerType) => {
54
54
return
55
55
}
56
56
57
- // force all standard requests to revalidate so that we always have fresh content
58
- // (we handle caching with ODBs instead of stale-while- revalidate)
57
+ // force Next to revalidate all ODB revalidation requests so that we always have fresh content...
58
+ // setting this header to the preview mode ID is how Next knows to revalidate
59
59
// eslint-disable-next-line no-underscore-dangle
60
60
if ( headers [ 'x-nf-builder-cache' ] === 'revalidate' && ! headers . __prerender_bypass ) {
61
+ console . log ( `Revalidating ${ url } ` )
61
62
headers [ 'x-prerender-revalidate' ] = this . renderOpts . previewProps . previewModeId
62
63
}
63
64
You can’t perform that action at this time.
0 commit comments