mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Make sure that 404's is not cached by CDN:s (#5088)
This commit is contained in:
parent
a6114d4d65
commit
9abbea8571
|
@ -193,7 +193,7 @@ async function doRender (req, res, pathname, query, {
|
|||
|
||||
export async function renderScriptError (req, res, page, error) {
|
||||
// Asks CDNs and others to not to cache the errored page
|
||||
res.setHeader('Cache-Control', 'no-cache, no-store, must-revalidate')
|
||||
res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate')
|
||||
|
||||
if (error.code === 'ENOENT' || error.message === 'INVALID_BUILD_ID') {
|
||||
res.statusCode = 404
|
||||
|
|
Loading…
Reference in a new issue