flask-cache icon indicating copy to clipboard operation
flask-cache copied to clipboard

Is that possible to delete_memoized according to part of parameters?

Open flniu opened this issue 8 years ago • 0 comments

Example:

@cache.memoize()
def param_func(a, b):
    return a+b+random.randrange(1, 50)

For the function above:

  • cache.delete_memoized('random_func') will delete all caches of this function;
  • cache.delete_memoized('param_func', 1, 2) will delete the cache with parameters a=1 and b=2;
  • Is that possible to delete the caches with parameters a=1 for all b values, something like cache.delete_memoized('param_func', 1)?

flniu avatar Feb 24 '17 06:02 flniu