Open
Description
Sometimes a change in the code should trigger the invalidation of the cache. The idea is to add the version
optional parameter to cache_memoize
, defaulting to None
. Then the version, if not None
, would be added to the cache key.
We could use it like this:
@cache_memoize(60)
def f(...):
Then we fix a bug in f
and write:
@cache_memoize(60, version=1)
Another bug fixed (so many 🐛 🪲 ) :
@cache_memoize(60, version=2)
So, when the fixes are deployed the cache will be invalidated, instead of returning a wrong cached value.
Metadata
Metadata
Assignees
Labels
No labels