Added functionality to clear caches.