Commit 9abbea85 authored by Tomas Roos's avatar Tomas Roos Committed by Tim Neutkens

Make sure that 404's is not cached by CDN:s (#5088)

parent a6114d4d
...@@ -193,7 +193,7 @@ async function doRender (req, res, pathname, query, { ...@@ -193,7 +193,7 @@ async function doRender (req, res, pathname, query, {
export async function renderScriptError (req, res, page, error) { export async function renderScriptError (req, res, page, error) {
// Asks CDNs and others to not to cache the errored page // 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') { if (error.code === 'ENOENT' || error.message === 'INVALID_BUILD_ID') {
res.statusCode = 404 res.statusCode = 404
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment