I read this document explaining Guava Cache: CachesExplained. I do understand what refreshAfterWrite and expireAfterWrite are doing. However, while explaining refreshAfterWrite, the document also mentions this:
"So, for example, you can specify both refreshAfterWrite and expireAfterWrite on the same cache, so that the expiration timer on an entry isn't blindly reset whenever an entry becomes eligible for a refresh, so if an entry isn't queried after it comes eligible for refreshing, it is allowed to expire."
This is the part that confuses me. For my understanding, if you want a key to be automatically refreshed, you only need to specify refreshAfterWrite. Why do we even want to use expireAfterWrite when ever refreshAfterWrite is used?