Automatic cleaning of the cache