Package com.googlecode.objectify.cache
Interface CacheControl
- All Known Implementing Classes:
CacheControlImpl
public interface CacheControl
Interface by which expiry times for cache entities is communicated to the cache system. The cache will
call this interface to find out how long to cache entities of a particular kind.
- Author:
- Jeff Schnitzer <[email protected]>
-
Method Summary
Modifier and TypeMethodDescriptiongetExpirySeconds
(com.google.cloud.datastore.Key key) Get the amount of time that entities of a particular key should be cached, if at all.default boolean
isCacheable
(com.google.cloud.datastore.Key key) Convenience method
-
Method Details
-
getExpirySeconds
Get the amount of time that entities of a particular key should be cached, if at all. This is used both to write entities/negative results to the cache and also to determine if we should look in the cache in the first place.- Returns:
- null means DO NOT CACHE. 0 means "no limit". Any other value is a # of seconds.
-
isCacheable
default boolean isCacheable(com.google.cloud.datastore.Key key) Convenience method
-