Google App Engine Memcache - Expiration

Is there support for slip acceleration in GAE MemcacheService? I can make a rough implementation where after every get () I do put (). This will effectively reset the expiration time, but this is obviously not an efficient solution.

Any pointers on how I can implement this more efficiently?

Thanks, Keyur

+2


a source to share


1 answer


The cache is usually LRU (last used). It is not advisable to manipulate this unless you are probably using the wrong mechanism.

As the saying goes, your circuit should work most of the time again, but why?



By http://code.google.com/appengine/docs/java/memcache/overview.html

How data caching ends By default, the values ​​stored in memcache are retained as long as possible. Values ​​can be flushed from the cache when a new value is added to the cache if the cache remains low in memory. When values ​​are preempted by memory pressure, the least used values ​​are preempted first. An application can provide an expiration time when the value is stored as a number of seconds relative to when the value was added, or as an absolute time in a future Unix epoch (a few seconds since midnight January 1, 1970). The value will be evicted no later than this time, although it may be evicted for other reasons. In rare cases, values ​​can also disappear from the cache before expiration for reasons other than memory pressure. Although memcache is robust against server failures,memcache values ​​are not persisted to disk, so a service failure could cause the values ​​to become unavailable. In general, an application should not expect a cached value to always be available.

+3


a source







All Articles