This is the facade used by Objectify to cache entities in the MemcacheService.
Entity cacheability and expiration are determined by a {@code CacheControl} object.In addition, hit/miss statistics are tracked in a {@code MemcacheStats}.
In order to guarantee cache synchronization, getAll() *must* be able to return an IdentifiableValue, even for entries not present in the cache. Because empty cache values cannot be made into IdentifiableValue, we immediately replace them with a null value and refetch (null is a valid cache value). If this refetch doesn't work, we treat the key as uncacheable for the duration of the request.
The values put in memcache are Key -> Entity, except for negative cache entries, which are Key -> String (the value NEGATIVE).
@author Jeff Schnitzer
|
|