|
I think it would be reasonable to introduce this, but only if it can be enabled explicitly by configuration.
My reasoning is that you can not predict that a set of entries which is being written now, will be ever be read again (ever or in reasonable soon future). All cache implementations have various sophisticated ways to track read hits to manage the cache content to select the most appropriate entries for caching, since rarely there is enough memory to cache them all it has to make a a though selection; for example Infinispan uses an approach based on the Low Inter-reference Recency Set. Opting to force writing into a cache an entry which was definitely never read before (as it's new) will cheat on the statistics collector of the cache, reducing its efficiency and not least forcing it to evict data which was definitely being read.
In short, you'd kick out valid entries to store doubtfully useful entries.
So while there might be some use cases in which this is beneficial, I think the current implementation is correct for most use cases.
|