Browse Source

Add cache-control 60s

test
Amio 6 years ago
parent
commit
69f99413a0
  1. 5
      service.js

5
service.js

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

Loading…
Cancel
Save