Skip to main content

Advanced Rate Limiting

PrismSlidingWindowMiddleware provides production-grade rate limiting with sliding time windows, customizable keys, and standard X-RateLimit-* response headers.

Per-IP Rate Limiting

Per-IP
Every IP gets 100 requests per 60-second sliding window.

Per-API-Key Rate Limiting

Different rate limits based on API key tiers:
Per-API-Key

Global Rate Limiting

Single shared limit across all clients:
Global

Response Headers

Every response includes standard rate limit headers:
When the limit is exceeded:

Custom Key Extraction

Build custom rate limit keys from any request data:
Custom Key
Use different stores for different middleware instances. Each store tracks its own counters independently.

Authentication

Combine rate limiting with authentication.

Metrics

Monitor rate limit hits in your metrics dashboard.