Simplify Rate-Limit System: Unify to a Single x/hour Limit with Standard Headers #59
Labels
backend
Changes related to Backand/API
documentation
Improvements or additions to documentation
priority: high
High priority tasks
Milestone
We propose refactoring our existing rate-limit system for endpoints that already enforce rate limits. Instead of our current multi-dimensional limits, we want to unify these to a single, configurable limit (denoted as "x" requests per hour, with the exact value to be decided later). This change will apply only to endpoints that currently have an existing rate limit, leaving endpoints without limits unchanged.
Additionally, we need to externalize all rate limit configuration settings to a separate config file (e.g., a .env file) rather than hardcoding them in the codebase. This will make adjustments easier across different environments and improve maintainability.
Proposed Changes:
Unified Limit for Selected Endpoints:
Standardized Rate-Limit Headers:
X-RateLimit-Limit
: Total allowed requests (e.g., "x").X-RateLimit-Remaining
: Requests remaining in the current window.X-RateLimit-Reset
: Time until the limit resets.Retry-After
header when the limit is exceeded.Externalized Configuration
The text was updated successfully, but these errors were encountered: