Skip to content

How to update cache evict in all kubernate pods springboot #1017

Answered by ben-manes
Poongavanama asked this question in Q&A
Discussion options

You must be logged in to vote

Caffeine is a local cache, so how you want to handle coherency is your decision.

A distributed cache would take care of that for you and caffeine is used behind the scenes by Coherence, Infinispan, and Redisson.

A message queue can be used to broadcast messages to all clients, such as a key invalidation or refresh. I recall that Redis built in this pattern natively on top of its pubsub for local caches. It is simple to build yourself on any MQ if you already use one.

You can query for all hosts and execute a curl using kubectl. That only requires an endpoint, making it easy to publish a config change or invalidate all caches in a pod. It’s not application oriented, more of a devops use case.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Poongavanama
Comment options

Answer selected by ben-manes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants