I don't delete but overwrite entities. Here is a code snippet.
class Task(webapp.RequestHandler):
def post(self):
...
for i in range(7):
for color in colors:
... # html
HTML(key_name=str(i)+color,html=html).put()
memcache.delete(str(i)+color)
And to write output I use this.
class Render(webapp.RequestHandler):
def get(self,i,color):
...
html = memcache.get(str(i)+color)
if not html:
html = HTML.get_by_key_name(str(i)+plain)
memcache.set(str(i)+color,html)
self.response.out.write(html)
I don't put all combinations into memcache directly since only about 5
are used regularly. I don't know if I should even be using memcache,
since the datastore query is so light. I'll try to use
memcache.flush_all() after the loop, instead of deleting each
separately. Maybe this helps in case memcache is indeed the culprit.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.