Improve make_cache_commands()