Skip to content

Commit

Permalink
Fix error pages' cdn cache issue. (vercel#1794)
Browse files Browse the repository at this point in the history
We do this by providing some headers mentioning not to cache.
  • Loading branch information
arunoda authored and rauchg committed Apr 24, 2017
1 parent ff0f1e6 commit da775f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export async function renderScript (req, res, page, opts) {
}

export async function renderScriptError (req, res, page, error, customFields, opts) {
// Asks CDNs and others to not to cache the errored page
res.setHeader('Cache-Control', 'no-store, must-revalidate')

if (error.code === 'ENOENT') {
res.setHeader('Content-Type', 'text/javascript')
res.end(`
Expand Down

0 comments on commit da775f2

Please sign in to comment.