kopia lustrzana https://github.com/badgen/badgen.net
Add cache-control 60s
rodzic
a9fdac5f31
commit
69f99413a0
|
@ -9,7 +9,10 @@ const LRU = require('lru-cache')
|
|||
const cache = new LRU({ max: 1000 })
|
||||
|
||||
function serveBadge (req, res, params) {
|
||||
res.writeHead(200, { 'Content-Type': 'image/svg+xml;charset=utf-8' })
|
||||
res.writeHead(200, {
|
||||
'Content-Type': 'image/svg+xml;charset=utf-8',
|
||||
'Cache-Control': 'public, max-age=60'
|
||||
})
|
||||
|
||||
const cached = cache.get(req.url)
|
||||
if (cached) {
|
||||
|
|
Ładowanie…
Reference in New Issue