Hello, question: ```# 1 - run foo in a flow, resul...
# ask-community
n
Hello, question:
Copy code
# 1 - run foo in a flow, result cached for 10s
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(seconds=10))
def foo():
    pass

# 2 - after 10s, run foo in a flow, result cached for 10h
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(hours=10))
def foo():
    pass

# 3 - run foo in a flow, result still cached for 10h (same code and inputs as before)
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(seconds=10))
def foo():
    pass
Any way to change
cache_expiration
?
refresh_cache
only updates the result in cache but does not reset
cache_expiration
. Reason: have tasks with large cache_expiration (hours/days) but if needed reset the cache (update the result) and restart the expiration from that moment.
d
I assumed that the
refresh_cache
invalidated all previous cache and creates new one with new expiration time.
n
from my tests it does not, can you confirm?