Alex Tbk
Alex Tbk

Reputation: 2104

Caffeine Cache - how does the expireAfterWrite() parameter works?

I would like to understand, how expired entries are removed when using the Caffeine Cache with the expireAfterWrite() parameter. Is the removal done upon calling the getIfPresent() and/or .size() method?

If yes, how can we make sure we dont run into issues when there many inserts but a few get() calls against the cache? I would like not to have to call the size() method in a scheduled method.

Upvotes: 0

Views: 199

Answers (0)

Related Questions