Skip to content

Commit da775f2

Browse files
arunodarauchg
authored andcommitted
Fix error pages' cdn cache issue. (vercel#1794)
We do this by providing some headers mentioning not to cache.
1 parent ff0f1e6 commit da775f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/render.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ export async function renderScript (req, res, page, opts) {
123123
}
124124

125125
export async function renderScriptError (req, res, page, error, customFields, opts) {
126+
// Asks CDNs and others to not to cache the errored page
127+
res.setHeader('Cache-Control', 'no-store, must-revalidate')
128+
126129
if (error.code === 'ENOENT') {
127130
res.setHeader('Content-Type', 'text/javascript')
128131
res.end(`

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy