I love and recommend Redis.
If you can use a Redis key instead of Django's cache, you can call get() on
the key. If the result is not None, now you have it. If it is None, you
know it didn't exist, so you can set it.
I don't think it's possible to have it work the way you want with the
default
I want to do an atomic "test and set if doesn't exist" on a cache key using the
django API. So far, that's easy.; cache.add() gives me exactly that.
But, if the key does exist, I also want to get the current value. All add()
gives me back is a flag saying if the key existed. Is there a way
2 matches
Mail list logo