micronaut-cache
micronaut-cache copied to clipboard
Null values are not cached
Is it intended that null
value is not cached?
I think it has to be configurable, because null
is valid value for me, or am I missing something?
Example:
@Cacheable("test")
fun getCompanyForUser(id: Long): String? {
// implementation
}
Not every user has to have company, but when the method returns null
, it's not cached, but called every time. I didn't even find this behaviour documented.
I am using io.micronaut.cache:micronaut-cache-caffeine:2.0.0.M2
.