Make sure the cache exists before trying to use it.