Skip to content

I'm curious about the operation logic of refreshAfterWrite options #1764

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

You must be logged in to vote

Hi @jojaeng2,

That feature is implemented in BoundedLocalCache#refreshIfNeeded. Unfortunately refresh is one of the most complicated, gnarly bit of logic because of the various interactions, which those explicit refresh methods also must cope with.

The feature is sometimes referred to as soft vs hard TTL or refresh ahead caching. When an entry has reached the expiration time then it is unusable, the cache should discard it, and if present but requested then it should be silently removed and treated as a cache miss. The refresh period is the duration when the entry is considered stale so it can be used if requested, but it would be desirable to reload it opportunistically to have a fresh c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jojaeng2
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