Using Django and Memcached, I have a series of caches that I would like to invalidate. I've been saving them all to unique version numbers so I can invalidate them. However, following the directions from the Django site I get a ValueError.
My version numbers look something like: 20991791. So integers, in general.
How can I invalidate all memcache keys in version 20991791?
Just for reference, setting as follows:
>>> cache.set('laugh',2,version=3)
By only knowing version number "3" I need to be delete all keys in version number three. I thought incr_version did this, but when I try, it gives a valueerror.
>>> cache.incr_version(3)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/opt/virtual-envs/govini-web/lib/python2.6/site-packages/django/core/cache/backends/base.py", line 214, in incr_version
raise ValueError("Key '%s' not found" % key)
ValueError: Key '3' not found