Add purge_cache function