django-cache-memoize icon indicating copy to clipboard operation
django-cache-memoize copied to clipboard

Update in bulk

Open thenewguy opened this issue 6 years ago • 1 comments

I have a situation where I am caching records from remote API get requests. I would like to run a background task that fetches a list in bulk and primes the cache in bulk.

It would be useful if there was a helper for this like ".invalidate"

Perhaps cache_memoized_function.set(args, result)? And potentially cache_memoized_function.set_in_bulk([(args1, result1), (args2, result2), ..., (argsN, resultN)])

Right now to do this I need to hit the list api and then parse the results and rerun the memoized function. So I have to fetch the records twice in this case

thenewguy avatar Jun 21 '18 22:06 thenewguy

I am happy to write the function and tests in a pr if the set function would be accepted

thenewguy avatar Jun 23 '18 00:06 thenewguy