Skip to content

kfirm/express-quicklee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-quicklee

express-quicklee is an express middleware for caching responses especially useful for responses that are coming from an outside source.

Install

npm install --save express-quicklee

Usage

var app = express();
var quicklee = require('express-quicklee');

app.use(quicklee());

app.get('/', function (req, res) {
    somePromiseWhichRetunsData(url).then(function(data) {
        res.send(data); // data will be cached 
    });
});

Options

You can also limit the size of the cache (default is no limit), and the selected strategy ('lru' or 'lfu' which is the default):

app.use(quicklee( { limit: 10000, strategy: 'lru' });

About

An express middle-ware for caching responses

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published