Rationale: though to my knowledge Prismic never caches a null value,
it is possible for caches to store null and for that to be different
from the key not existing in cache. Adding a has method to the
CacheInterface allows developers to provide a more reliable way to
tell these apart, if available for the cache backend. This also leads
to a fuller cache interface. In many cases (especially if the value is
large, as some will be in Prismic) checking if a key exists in cache
can be much faster than retrieving the value and checking against
null.
Rationale: though to my knowledge Prismic never caches a null value, it is possible for caches to store null and for that to be different from the key not existing in cache. Adding a has method to the CacheInterface allows developers to provide a more reliable way to tell these apart, if available for the cache backend. This also leads to a fuller cache interface. In many cases (especially if the value is large, as some will be in Prismic) checking if a key exists in cache can be much faster than retrieving the value and checking against null.