Added a method for building cache key.