I have a service with proxy-cache activated, and I want to activate a rate limit too. Is there a way to configure this so the requests that hits the cache does not count for the rate limit?
For example. I configure a 5 request per minute limit. If a service makes 10 requests but 7 of them hits the cache, the service will only “consume” 3 requests from the rate-limit because the other 7 are answered by the cache.
I’m trying and can`t make it to work. It seems that the rate limit plugin has more priority than the cache one. I don’t know if this kind of behaviour can be configured in Kong.
Deploying more kong instances is a little too much.
I think that this is a Priority “issue”. The rate limit plugin is executed first, then the cache one:
RateLimitingHandler.PRIORITY = 901
local ProxyCacheHandler = {
VERSION = “1.3.2”,
PRIORITY = 100,
}
So, mayber I’ll try to fork the cache one and modify its priority to 902 or similar, and test if then the cache plugin executes first and the rate limit is not affected.