kopia lustrzana https://github.com/badgen/badgen.net
Add cache-control header to doc pages
rodzic
acee60f85b
commit
bced3ec3f4
|
@ -9,6 +9,9 @@ export default async function (req, res) {
|
|||
|
||||
if (helpMarkdown) {
|
||||
console.info(`DOC ${name}: ${req.url}`)
|
||||
|
||||
res.setHeader('Cache-Control', 'public, max-age=86400, s-maxage=604800, stale-while-revalidate=86400')
|
||||
|
||||
return serveMarked(helpMarkdown, {
|
||||
title: `${name} badge | Badgen`,
|
||||
inlineCSS,
|
||||
|
|
2
index.ts
2
index.ts
|
@ -28,7 +28,7 @@ const serveStaticHeaders = [
|
|||
source: "**/*",
|
||||
headers: [{
|
||||
key: "Cache-Control",
|
||||
value: "public, max-age=86400, s-maxage=86400, stale-while-revalidate=86400"
|
||||
value: "public, max-age=86400, s-maxage=604800, stale-while-revalidate=86400"
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
|
Ładowanie…
Reference in New Issue