Fix int to duration conversion for cache
Merge pull request #3379 from gmethvin/cache-duration

cache.get() only works for the first call