0.0.1 • Published 7 years ago
sliding-cache v0.0.1
sliding-cache
A node in-memory cache helper that serves an object from cache as long as it requested within the specified time frame.
Usage
var SlidingCache = require('sliding-cache');
var slidingCache = new SlidingCache();
var liveDataSource = function(callback) {
httprequestmodule.get(url, data, function(err, response) {
if(!err) {
callback(response.body);
}
});
}
slidingCache.Run('SOME_KEY_HERE', liveDataSource, function(data) {
res.json(data);
}, 7000);
0.0.1
7 years ago