Add cleanup method to cache.