Skip to content

Does caffeine loading cache do automatic interning of cached values? #809

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

You must be logged in to vote

No, nothing magical like that. You can think of it as a ConcurrentHashMap with an automatic removal policy. The entries are shared until evicted, loaded if not found, etc. It does not try to keep them around any longer, e.g. by calling String.intern. It doesn't copy objects into or out of the map, etc. It should be boring and feel similar to the core Java collections.

(We do offer an Interner for those who want that behavior)

Replies: 1 comment 1 reply

Comment options

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