【发布时间】:2016-08-12 16:49:39
【问题描述】:
来自缓存文档:https://github.com/objectify/objectify/wiki/Caching
The session cache is local to the Objectify instance. If you start a new session (via ObjectifyFactory.begin()), it will have a separate cache. If you use the thread-local ObjectifyService.ofy() method, the session cache will "just work" appropriately.
和
A get-by-key operation (single or batch) for a cached entity will return the entity instance without a call to the datastore or even to the memcache
我的问题是:
请求 1 由实例 A 提供服务:对象已更新并保持不变。由于对象已被修改,会话缓存将被更新。
请求 2 由实例 B 提供服务(由于先前的请求,该对象已经在会话缓存中):会话缓存将有所不同,因为它是另一个实例。 请求如何获取更新的实体而不是之前的实体?
App Engine 内存缓存在多个实例之间共享,但会话缓存是每个实例(甚至是 Objectify 实例)的单个缓存。
会话缓存是否以某种方式在所有实例之间同步?
不同实例服务的不同请求是否可能具有同一对象的不同版本?
【问题讨论】:
标签: google-app-engine session caching instance objectify