determine cache_enabled in same scope as the value is used.