How to match redis key patterns using native django cache?

Viewed 8871

I have a series of caches which follow this pattern:

key_x_y = value

Like:

  'key_1_3' = 'foo'
  'key_2_5' = 'bar'
  'key_1_7' = 'baz'

Now I'm wondering how can I iterate over all keys to match pattern like key_1_* to get foo and baz using the native django cache.get()?

(I know that there are way, particularly for redis, that allow using more extensive api like iterate, but I'd like to stick to vanilla django cache, if possible)

2 Answers
Related