Updated template cache key generation.