kopia lustrzana https://github.com/badgen/badgen.net
Set live cache maxAge to 2 minutes
rodzic
fa76e5b7c6
commit
fd8246438c
|
@ -2,7 +2,7 @@ const LRU = require('lru-cache')
|
||||||
|
|
||||||
const cache = LRU({
|
const cache = LRU({
|
||||||
max: 5000,
|
max: 5000,
|
||||||
maxAge: 3e4,
|
maxAge: 12e4, // 2 minutes
|
||||||
stale: true
|
stale: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ function clearCache (req, res) {
|
||||||
cache.reset()
|
cache.reset()
|
||||||
|
|
||||||
res.writeHead(200)
|
res.writeHead(200)
|
||||||
res.end(`Cleaned ${count}\n${keys}`)
|
res.end(`Cleared ${count}\n${keys}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Ładowanie…
Reference in New Issue