Skip to content

Commit

Permalink
Add max-age to cache header for 404s (vercel#1)
Browse files Browse the repository at this point in the history
This got added in canary12 of 7.0.0 vercel#5088. but we can't wait for that version
  • Loading branch information
linqiu authored and Stephen Solka committed Sep 7, 2018
1 parent 0fa642a commit 8ede899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,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
Expand Down

0 comments on commit 8ede899

Please sign in to comment.