-
Notifications
You must be signed in to change notification settings - Fork 86
chore: standardise ODB terminology #1641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
2546f2c
941a34e
777e76a
6fe8e0f
d09f656
841c46a
4b3ce7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,15 +129,15 @@ const makeHandler = (conf: NextConfig, app, pageRoot, staticManifest: Array<[str | |
// Long-expiry TTL is basically no TTL, so we'll skip it | ||
if (ttl > 0 && ttl < ONE_YEAR_IN_SECONDS) { | ||
result.ttl = ttl | ||
requestMode = 'isr' | ||
requestMode = `odb ttl=${ttl}` | ||
} | ||
} | ||
multiValueHeaders['cache-control'] = ['public, max-age=0, must-revalidate'] | ||
} | ||
multiValueHeaders['x-render-mode'] = [requestMode] | ||
console.log( | ||
`[${event.httpMethod}] ${event.path} (${requestMode?.toUpperCase()}${result.ttl > 0 ? ` ${result.ttl}s` : ''})`, | ||
) | ||
multiValueHeaders['x-nf-render-mode'] = [requestMode] | ||
|
||
console.log(`[${event.httpMethod}] ${event.path} (${requestMode?.toUpperCase()})`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this console.log added for debugging purposes and accidentally added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks but nope - this is by design so that the ODB request is logged in the function logs |
||
|
||
return { | ||
...result, | ||
multiValueHeaders, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment linking to documentation about the 60 second minimum would be helpful for folks navigating through the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I popped a note in the readme because there are various different demo pages with
revalidate: 60
and thought it best not to duplicate the comment everywhereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may have been deliberately set to 1 to check that it's correctly being changed to 60.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ascorbic ah, i see - i'll change it back and add a comment