如何将获取的实体存储在App Engine的内存缓存中? [英] How do I store a fetched entity in memcache for App Engine?

查看:106
本文介绍了如何将获取的实体存储在App Engine的内存缓存中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于App Engine中的每个新请求都会创建一个新的处理程序,因此我要更改和放置(使用POST)的实体必须再次检索.这似乎很浪费,因为我刚才已经用GET中的信息填充了表格.

Because each new request in App Engine creates a new Handler, the entity I'd like to alter and put (using POST) has to be retrieved again. This seems wasteful, since I've populated the form with the information from GET a moment earlier.

如何在App引擎的内存缓存中存储密钥,获取的实体或密钥/实体对?

How do I store a key, fetched entity, or key/entity pair in memcache for App Engine?

推荐答案

来自

Memcache将存储可刺破"的所有内容.

Memcache will store anything that is 'pickleable'.

您可以通过以下导入来访问memcache:

You get access to memcache with the following import:

from google.appengine.api import memcache

这篇关于如何将获取的实体存储在App Engine的内存缓存中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆