<@ULVA73B9P> what is the environment variable to g...
# ask-marvin
s
@Marvin what is the environment variable to globally change the default value of "cache policy" of tasks to "NONE" ?
m
thought for 110.5 seconds
Short answer: set
PREFECT_TASKS_DEFAULT_NO_CACHE=true
. Details: -
PREFECT_TASKS_DEFAULT_NO_CACHE
(bool) sets the default cache policy on all tasks to NO_CACHE (i.e., “NONE”). Tasks can still override this by explicitly setting a
cache_policy
. - If you want to hard-disable caching everywhere regardless of per-task settings, use
PREFECT_TASKS_DISABLE_CACHING=true
. Examples:
Copy code
# Prefer this to make the default policy NO_CACHE
export PREFECT_TASKS_DEFAULT_NO_CACHE=true

# Or, strictly disable caching everywhere
export PREFECT_TASKS_DISABLE_CACHING=true
Docs: Settings reference (see Tasks settings:
tasks.default_no_cache
and
tasks.disable_caching
) Note: In Prefect 3.x, the default cache policy is a composite that includes inputs, task source, and run id; setting the env var above changes that default to no cache.