Hello I am Aawez Khan(Nodejs Community Lead Developer) aawez@nodejs.community.
Caching is a commonly used technique to improve the performance of any application
var cacheService = require("az-rate-limit");
var client = cacheService.cache;
app.get("/", client("1 minutes"), (req, res) => {
// retrieve data and request before 1 minutes will get data from cache
res.json([
your response
]);
});
app.listen(5000, function () {
console.log(`Example app listening on 3000!`);
});
-
valid units
- ms, second, minute, hour, day, week, month. -
duration format
- [time][unit] as5 minutes