7 months ago

Question about Rate Limiting

Posted 7 months ago by michaeln

Laravel Up & Running states: rate limiting determines the number of times one can access a given route during a specified period of time. The second parameter to the rate middleware specifies the number of minutes for Laravel to wait before resetting the count.

My question is: when specifically is the count reset to zero? If I told Laravel to allow 60 API calls to a given resource per minute, would that mean I could access the resource 1 time during the 1st second, wait 59 seconds, access it 59 times within the 59th second, wait another second, and then access it 60 times within the 1st second of the 2nd minute? OR! Does the counter work backwards, from the last access attempt made, to effectively measure the total number of attempts made during any 60-second period?

Please sign in or create an account to participate in this conversation.