NIT: `_gen_key` is a little confusing. That made me think it was generating a random key. I'd prefer something like `_cache_key` or `_get_cache_key`.