<@ULVA73B9P> Are cached results deleted after expi...
# ask-marvin
s
@Marvin Are cached results deleted after expiry
m
In Prefect 3.x, cached results can be given an expiration using the
cache_expiration
keyword in the task decorator. However, the documentation does not explicitly state that cached results are automatically deleted after expiry. It is more likely that the expired cache becomes invalid and is not used, rather than being actively deleted. For more details, you can refer to the Prefect 3.x task caching documentation.
s
@Marvin Is there some sort of cleanup function or garbage collection that would get rid of stale results
m
The Prefect 3.x documentation does not explicitly mention a cleanup function or garbage collection mechanism for deleting stale or expired cached results. Caching in Prefect relies on result persistence, which is off by default, and it seems that expired caches simply become invalid rather than being actively deleted. However, you can use the
refresh_cache
option or the
PREFECT_TASKS_REFRESH_CACHE
setting to ignore cached data and rerun tasks, effectively refreshing the cache. For more information, you can refer to the task caching documentation.