2.0.3 • Published 2 years ago

az-rate-limit v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

az-rate-limit

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

Cache a route Ready to use sample

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!`);
});

API

  • valid units - ms, second, minute, hour, day, week, month.
  • duration format - time as 5 minutes