Skip to content

Commit

Permalink
better cache size defaults (64mb)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradoyler committed Aug 18, 2016
1 parent 633d1bc commit c4b0a8b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ var LRU = require('lru-cache')

var queues = {}
var redirects = {}
var defaults = {max: 500, maxAge: 100}
var defaults = {
max: 64 * 1000000, // ~64mb
length: function (n, key) {
if (n.body && typeof n.body === 'string') {
return n.body.length
}
return 1
},
maxAge: 200 // deletes stale cache older than 200ms
}
var cacheStore = new LRU(defaults)

module.exports.config = function (opts) {
Expand Down

0 comments on commit c4b0a8b

Please sign in to comment.