Do I need to evict redis cache manually in multi-server environment? #125
Replies: 1 comment
-
|
@MarcGiffing @ttulka hello guys, A few month ago, I implemented smart TTL calculation for Redis entries, so it is not nessesary(in case of redis) to specify global TTL. If I understand correctly you don't use built-in to Bucket4j integrations for Redis and implemented own instead, so you can adopt my code into your integration in order to free your clients from specifiyng TTL. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thanks for the starter :)
I'm using bucket4j and your starter to set up rate limits for several endpoints in my Spring boot application which is deployed to the server in production with several instances so I'm using Redis as the storage. My question is, do I need to manually evict the cache periodically? There are many requests coming to the server so if it's not evicted, it would probably be filled up very soon.
I use
currencyRateCachewith@Cacheableannotation so I'm using@CacheEvictfor this cache. But do I really need evicting forapiRequestsThrottlingCacheas well?Here's my Redis Configuration:
Here's my bucket4j configuration:
I'm limited to Java 8 and Spring Boot 2.6.1 so I'm using
bucket4j-spring-boot-starterof version0.6.1andbucket4j-corewithbucket4j-redisof version7.6.0.Beta Was this translation helpful? Give feedback.
All reactions