jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.5k stars 132 forks source link

Restore TokenBucket/RateLimiter state from localStorage #83

Open wzijden opened 3 years ago

wzijden commented 3 years ago

When using this on a client site web page, you will also want to rate limit customers that continously refresh your web page.

But in this case, the rate limiter will be reinitialized on each page load, and its previous state thrown away.

Can we someone serialize the current state of the Rate Limit to local storage, so that we can recover it on page load?