Clean_cache function