added functionality to use cache_key if exists