Skip to content

Fixed window

Fixed window counting places requests into a time interval and resets the count when that interval expires.

  • You want the smallest operational and computational cost.
  • Small bursts around a window boundary are acceptable.
  • Your policy is naturally expressed as “N requests per interval.”
const limiter = createRateLimiter({
algorithm: Algorithms.FIXED_WINDOW,
limit: 100,
windowMs: 60_000,
store,
});