Add automatic pruning of the cache on an interval to clear expired entries.