Due to the way caching is disabled the SHOULD_CACHE_FN() is used
to determine if new values are stored in the cache backend, and is
only called when the regeneration is required. If dogpile is
configured to connect to a memcache, redis, etc to store data
it is possible with caching disabled to still pull values from
the cache (SHOULD_CACHE_FN has no bearing on reads).
The issue described only impacts the use of the memoization
decorator.
This change forces dogpile to use the null backend if caching is
globally disabled to ensure no data is read from the external
cache. This will not affect subsystem disabling of cache.
Even with cache disabled but reads coming from the external cache,
there stale data is not a concern as invalidates will still be
processed and the data from the backend will eventually timeout
in most cases.
Change-Id: I845b6cc18faa2be516676eeacc574473ca84c995
Closes-Bug: #1567413