Victor
Victor

Reputation: 8480

MemcacheService Expiration

How the best way to increment the Expiration time for objects in Memcache using GAE in Java?

I will try setting the object again, but this is the correct approach?

Upvotes: 1

Views: 205

Answers (3)

dan-boa
dan-boa

Reputation: 610

On setting it again with a new expiry time, as mentioned in the previous answers. But you should also be concerned about the new expiry time selected. Your expiry time must also be generated taking into account the data and its freshness rate.

Upvotes: 0

Nick Johnson
Nick Johnson

Reputation: 101139

If you set an explicit expiration time, storing the record again with a new expiration time will update the expiration.

Upvotes: 1

dragonx
dragonx

Reputation: 15143

memcache uses a least recently used eviction algorithm. If you query on the object, it should cause it to be retained longer.

Upvotes: 1

Related Questions