Hello, a question about cache. Is there a schedule...
# prefect-community
a
Hello, a question about cache. Is there a scheduled task or function that deletes expired cache?
a
No need to do that manually; Prefect takes care of that automatically for you. You can set it, e.g. using:
Copy code
@task(cache_for=timedelta(hours=1))
If you need to clean the cache sooner, you can set it in your task to a lower threshold. If you are asking for Prefect 2.0, LMK since this is a bit different there.
k
Are you talking about cache or result or target?
a
I'm talking about cache. I want to make sure that really old cache is not piling up indefinitely
k
But the cache is not what piles up because it’s just a state stored in the Prefect database
a
(I use cache_for=...)
ok, if that's in DB, that's probably auto-cleared
is there a similar mechanism for results, e.g. S3 results?
k
No we don’t have anything that deletes any results. For S3 though, you could do a TTL on the bucket?
a
yeah, I think that would work