I want to flush my cache whenever I post a new note on my application.
So in my admin area, handled by a separate admin.py, I have this bit
of code:
class NoteController(webapp.RequestHandler):
def post(self, key):
if key:
note = db.get(key)
else:
note = Note()
note.content = self.request.get('content')
note.put()
logging.debug("New note created")
if memcache.flush_all() is True:
logging.debug("Memcache flushed")
else:
logging.warning("Memcache flush failure")
self.redirect('/admin/')
However, it does not seem to do anything at all.
The note gets created, but no log comes up in the dev log console and
the cache remains intact.
But when I run memcache.flush_all() in the Interactive Development
Console manually, everything gets cleared in an instant.