redis-simple-cache icon indicating copy to clipboard operation
redis-simple-cache copied to clipboard

Optional keyword to forcibly bypass cache

Open safijari opened this issue 8 years ago • 1 comments

So, in case I'm not understanding things correctly, is there a way to handle the following use case: I have a function which I need to cache most of the time, but in a few very specific cases I need it run its course. The function is grabbing things from a web api, most of these do not change but some do, and that fact only matters in one use case. Can I provide an additional keyword just for that specific use case?

e.g.

get_data(dont_cache=True)

I'm thinking the best place to implement this (in case this doesn't already exist) would be here. Thoughts?

safijari avatar Nov 10 '17 18:11 safijari

So if you already know that data will be different, is it not better to expire that data in cache? Or am I missing the use-case entirely?

szaydel avatar Nov 10 '17 19:11 szaydel