Reputation: 8480
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
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
Reputation: 101139
If you set an explicit expiration time, storing the record again with a new expiration time will update the expiration.
Upvotes: 1
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