Add cache-control 60s

pull/5/head
Amio 2018-06-26 19:13:30 +08:00
rodzic a9fdac5f31
commit 69f99413a0
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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) {