我在 Google App Engine (Python) 中使用 Memcache 已经有一段时间了,通常它工作得很好。在过去的几天里,虽然我注意到使用下面示例中的一些代码,当我更新数据库条目后立即更新它时,它没有及时得到它。这是由于将条目存储在数据库中所需的时间长度吗?有什么解决办法吗?
# I store the comment here
c = Comment(content = content, submitter = submitter, group_id=int(group_id), user_id = user_id)
c.put()
# Right after I store the comment I refresh the cache
comment_cache(int(group_id), True)
通常最新的评论不在缓存中。