mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fix error pages' cdn cache issue. (#1794)
We do this by providing some headers mentioning not to cache.
This commit is contained in:
parent
ff0f1e6c72
commit
da775f2e11
|
@ -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(`
|
||||
|
|
Loading…
Reference in a new issue