correctly set cache_mode attribute