UPSTASH_REDIS_REST_TOKEN
UPSTASH_REDIS_REST_URL
@strapi
, the key will be
@strapi:<method>:<route>:<identifier>
.["GET", "POST"]
*
matches all routes. path: "/api/restaurants/:id"
path: "/api/restaurants"
ip
: The IP address of the user. header
: The value of a header key. You should pass the source in the header.<HEADER_KEY>
format. header.Authorization
will use the value of the Authorization
fixed-window
: The fixed-window algorithm divides time into fixed intervals. Each interval has a set limit of allowed requests. When a new interval starts, the count resets. sliding-window
:
The sliding-window algorithm uses a rolling time frame. It considers requests from the past X time units, continuously moving forward. This provides a smoother distribution of requests over time. token-bucket
: The token-bucket algorithm uses a bucket that fills with tokens at a steady rate. Each request consumes a token. If the bucket is empty, requests are denied. This allows for bursts of traffic while maintaining a long-term rate limit."ms" | "s" | "m" | "h" | "d"
20s
means 20 seconds.