What if I do not include expireAfterWrite is there any harm?

21 views
Skip to first unread message

Fazeel Usmani

unread,
Aug 5, 2022, 1:19:45 AM8/5/22
to guava-discuss
I want to store 3 constant values which should be always in cache and is used almost everytime. I thought of removing expireAfterWrite and will this work?
Currentlly, there are only 3 entries for SystemUser and limiting it to only 100.



private final LoadingCache<String, Optional<SystemUser>> systemUserCache = CacheBuilder
.newBuilder()
.maximumSize(100)
.build(
new CacheLoader<>() {
@Override
public Optional<SystemUser> load(String wsGlobalId) {
return getSystemUser(wsGlobalId);
}
}
);

Reply all
Reply to author
Forward
0 new messages