Is there a way to not cache some specific elements using Guava Cache? I still want the element to be returned, but not cached.
For example:
LoadingCache guavaCache;
public Element load(String key) {
Element element = requestElement(key);
if(element.isActive == false){
guavaCache.dontCache(element);
}
return element;
}