express-quicklee

1.0.1 • Public • Published

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' });

Dependencies (1)

Dev Dependencies (6)

Package Sidebar

Install

npm i express-quicklee

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

44.3 kB

Total Files

13

Last publish

Collaborators

  • kfir.marouani