Each request inside a fixed time increases a counter. Once the counter reaches the maximum allowed number, all further attempts are rejected.

Pro:

  • Newer attempts are not starved by old ones.
  • Low storage cost.

Con:

A burst of attempts near the boundary of a window can result in a very high request rate because two windows will be filled with attempts quickly.

IMPORT_PATH: "@daiso-tech/core/rate-limiter/policies"

Implements

Constructors

Methods