Commit da775f2e authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by Guillermo Rauch

Fix error pages' cdn cache issue. (#1794)

We do this by providing some headers mentioning not to cache.
parent ff0f1e6c
...@@ -123,6 +123,9 @@ export async function renderScript (req, res, page, opts) { ...@@ -123,6 +123,9 @@ export async function renderScript (req, res, page, opts) {
} }
export async function renderScriptError (req, res, page, error, customFields, 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') { if (error.code === 'ENOENT') {
res.setHeader('Content-Type', 'text/javascript') res.setHeader('Content-Type', 'text/javascript')
res.end(` res.end(`
......
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