Throttling period is not "rolling" #610
Unanswered
rouaneta
asked this question in
Questions (Q&A)
Replies: 1 comment
-
This also took me out for a spin, as I couldn't understand why our request specs were being flaky. According the source correctly, the logic to set the cache expiry is: @last_epoch_time = Time.now.to_i
expires_in = (period - (@last_epoch_time % period) + 1).to_i So I believe you're right and this is essentially a ticker, not a rolling window. This isn't necessarily an issue for our use cases (we use small windows to prevent abuse) but agree that the documentation could be more explicit. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
The doc (https://github.com/rack/rack-attack#throttling) seems to indicate that the throttling period is a rolling period over which one cannot do more than x requests/period, but I noticed it was more a fixed reset period for the cache.
Did I miss something? Do you know if this behaviour was intentional?
In any case, a good first step could be to clarify the doc (happy to make a suggestion).
Steps to reproduce
Would be happy to hear your thoughts :) thanks
Beta Was this translation helpful? Give feedback.
All reactions