I am wondering why ratelimit can send zero increment requests to redis database.
When getHitsAddend() returns zero, for example when STOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMIT and the counter is over limit, ratelimit sends INCRBY(0) request to redis. Such a behavior is even verified by unit tests so I think this must have been made intentionally.
I'd guess that the purpose of STOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMIT is to avoid unnecessary load on redis but zero increments make redis load too.
So what is the purpose? Anyone knows?
I am wondering why ratelimit can send zero increment requests to redis database.
When
getHitsAddend()returns zero, for example whenSTOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMITand the counter is over limit, ratelimit sendsINCRBY(0)request to redis. Such a behavior is even verified by unit tests so I think this must have been made intentionally.I'd guess that the purpose of
STOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMITis to avoid unnecessary load on redis but zero increments make redis load too.So what is the purpose? Anyone knows?