Every read misses, every write is dropped, and NoopCacheStore.remember
still returns the computed value — which is exactly the behaviour
CacheStore requires of an unavailable cache. That makes
this a substitutable stand-in rather than a stub: code written against the
interface cannot tell it apart from a real cache that keeps missing, because
there is no observable difference to find.
Use it to run deliberately without a cache, or as the test double
that proves a caller does not secretly depend on a hit.
A cache that stores nothing.
Remarks
Every read misses, every write is dropped, and NoopCacheStore.remember still returns the computed value — which is exactly the behaviour
CacheStorerequires of an unavailable cache. That makes this a substitutable stand-in rather than a stub: code written against the interface cannot tell it apart from a real cache that keeps missing, because there is no observable difference to find.Use it to run deliberately without a cache, or as the test double that proves a caller does not secretly depend on a hit.
Author
Bayu Dwiyan Satria
Version
1.0.0
Since
1.0.0