kopia lustrzana https://github.com/badgen/badgen.net
Adjust cache header
rodzic
83859a1ccb
commit
7c41eba91e
|
@ -1,6 +1,6 @@
|
|||
import cheerio from 'cheerio'
|
||||
import got from '../libs/got'
|
||||
import { millify, stars, version, versionColor } from '../libs/utils'
|
||||
import { millify, version, versionColor } from '../libs/utils'
|
||||
import {
|
||||
badgenServe,
|
||||
BadgenServeMeta as Meta,
|
||||
|
|
|
@ -31,7 +31,8 @@ export default function (req, res, options: ServeBadgeOptions) {
|
|||
})
|
||||
|
||||
const staleControl = `stale-while-revalidate=604800, stale-if-error=604800`
|
||||
res.setHeader('Cache-Control', `public, max-age=10, s-maxage=${sMaxAge}, ${staleControl}`)
|
||||
const cacheControl = `public, max-age=20, s-maxage=${sMaxAge}, ${staleControl}`
|
||||
res.setHeader('Cache-Control', cacheControl)
|
||||
res.setHeader('Content-Type', 'image/svg+xml;charset=utf-8')
|
||||
res.statusCode = code
|
||||
res.end(badge)
|
||||
|
|
Ładowanie…
Reference in New Issue