Sanitize key for cache filename