How does prefect cache? - I’m looking at Luigi, wh...
# ask-community
b
How does prefect cache? • I’m looking at Luigi, which just saves out artifacts as I’ve determined (pickle, joblib, csv, etc.). I want similar behavior in Prefect because I have computationally intensive intermediate tasks that i’d like use for analysis. • In Luigi, i can delete the artifact to re-start the task. In prefect can I clear the cache of a particular task?
r
Prefect caches task results in memory during a flow run, then to the path in PREFECT_LOCAL_STORAGE_PATH. You can of course clear the relevent entry by cache key
🙌 1
🙏 2
b
what caching thing does it use? pickle?
b
Copy code
You can define a task that is cached based on its inputs by using the Prefect task_input_hash. This is a task cache key implementation that hashes all inputs to the task using a JSON or cloudpickle serializer. If the task inputs do not change, the cached results are used rather than running the task until the cache expires.
thanks!