sihyeonn opened a new pull request, #12756:
URL: https://github.com/apache/apisix/pull/12756

   ### Description
   
   This PR introduces sliding window support to the `limit-count` plugin for 
Redis- and Redis Cluster–based policies while preserving the existing fixed 
window behavior by default.
   
   - Adds a new `window_type` option (`fixed` | `sliding`) to the `limit-count` 
plugin configuration, with `fixed` as the default for backward compatibility.
   - Enforces that `window_type = "sliding"` is only allowed when the `policy` 
is `redis` or `redis-cluster` to avoid unsupported combinations.
   - Extends the Redis (`limit-count-redis`) and Redis Cluster 
(`limit-count-redis-cluster`) implementations to enforce an exact N requests 
per rolling time window when `window_type` is set to `sliding`.
   - Adds test cases for the sliding window behavior in both Redis and Redis 
Cluster modes (`limit-count-redis-sliding.t`, 
`limit-count-redis-cluster-sliding.t`).
   - Updates the English and Chinese `limit-count` plugin documentation to 
describe the new `window_type` option, its behavior, and performance 
considerations when using sliding windows.
   
   The default behavior remains unchanged for existing configurations that do 
not specify `window_type` or continue to use `fixed`.
   
   #### Which issue(s) this PR fixes:
   
   Fixes #
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible (If not, 
please discuss on the [APISIX mailing 
list](https://github.com/apache/apisix/tree/master#community) first)


-- 
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]

Reply via email to