Added a close function to close the cache once transforms are finished.