bozorgmehr96 opened a new issue, #11880:
URL: https://github.com/apache/apisix/issues/11880
### Description
The `limit-count` plugin currently uses a sliding window approach. While
effective for preventing DDoS attacks, this method is not ideal for quota
limiting. To address this, I propose introducing two new attributes:
`window_type` and `fixed_window_name`.
- **`window_type`**: An enum that accepts values `sliding` (default) and
`fixed`.
- **`fixed_window_name`**: An enum that specifies the time unit for fixed
windows, such as `minute`, `day`, `month`, `year`, etc.
## Proposed Behavior
### Sliding Window (default)
- When `window_type` is set to `sliding` (or left empty), the `time_window`
attribute is required, and the plugin will retain its current behavior.
### Fixed Window
- When `window_type` is set to `fixed`:
- The `time_window` attribute is ignored (or must be empty).
- The `fixed_window_name` attribute is required.
- The plugin calculates the end of the current period based on the
specified `fixed_window_name` and uses Redis's `EXPIREAT` command to set the
expiration time for the key.
## Open Question
Should the timezone be explicitly configurable (e.g., via an additional
attribute)? Alternatively, should the plugin:
- Default to the server's timezone?
- Always use UTC?
---
If this feature aligns with the project's goals, I am willing to work on its
implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]