Fix for #1852: Always invalidate inmemory_caches.

Invalidation of in-memory caches was dependent on `caching.is_enabled()`.  In-memory caches are always working, so always should be invalidated.