I followed https://developers.google.com/appengine/docs/python/memcache/usingmemcache, and got memcached work.
but I have a problem when I try to update cache before it expires.
for example, after:
"memcache.add('key', data, 60000000000)"
if I want to update the information stores in “key”
I was hoping there was an API of
“memcache.update(‘key’, newData, 60000000000)” (NO)
I tried to add again:
“memcache.add(‘key’, newData, 60000000000)”
but it doesn’t work. It didn’t replace the previous one.
Anyone can give me some ideas how to do it?
I know there is a
“memcahed.flush_all()”
But it flush the whole cache.
Use
memcache.set('key', data, 60000000000)to set the value, regardless of previous contents in cache. See:https://developers.google.com/appengine/docs/python/memcache/functions