set duration for cache and add method to change default ttl from application