mCaptcha Cache
Redis module that implements
leaky bucket algorithm
[](https://github.com/mCaptcha/cache/actions/workflows/linux.yml)
[](https://hub.docker.com/r/mcaptcha/cache)
[](https://deps.rs/repo/github/mCaptcha/cache)
[](http://www.gnu.org/licenses/agpl-3.0)
[](https://matrix.to/#/+mcaptcha:matrix.batsense.net)
## Features
- [x] Timers for individual count
- [x] Clustering
- [x] Persistence through RDB
- [ ] Persistence through AOF
## Motivation
[mCaptcha](https://github.com/mCaptcha/mCaptcha) uses a [leaky-
bucket](https://en.wikipedia.org/wiki/Leaky_bucket)-enabled counter to
keep track of traffic/challenge requests.
- At `t=0`(where `t` is time), if someone is visiting an mCaptcha-protected website, the
counter for that website will be initialized and set to 1.
- It should also automatically decrement(by 1) after a certain period, say
`t=cooldown`. We call this cool down period and is constant for a
website.
- If at `t=x`(where `x