alexk307 / cache_deco

Backend agnostic cache decorator
MIT License
81 stars 7 forks source link

Tag and function name based lookup "tables" #1

Open whytheplatypus opened 8 years ago

whytheplatypus commented 8 years ago

Thinking that this could be used to let other aspects of a program interact with a cache based on function name or a given tag. (e.g. reset all cache's tagged with a certain model name)

No idea if it works, still have to figure out the tests.

alexk307 commented 8 years ago

This won't work currently because I've rolled my own Redis client, so those functions you've added (sadd, delete) are not implemented yet. Decided to write my own Redis client as an exercise, not for any specific reason. Should be easy to add those methods if that's the way we want to do it.

I like the idea; there is no way currently to reset the cache. I was thinking something along the lines of giving it a Django model or any object implementing an interface with a last_modified type field to invalidate the cache.