well it really don't  exist any api to make some data save to memcached
without expiry time. cuz you can consider that:

if you keep a bundle of data in the memcached server without expiry time,
new data will not replace the old one (by the same Key).
in the other side, data without expiry time, then it will stay in the
memory forever till the memcached server is crashed or server shut down.
the result can't be in your control.

but, if you do wanna make data without expiry time, you can make a certain
long expire time (1 day for example). when you fetch the data, you replace
the data with new expire time, then the expire time is delayed.

demo:

obj=mcc.get("Key");
mcc.replace("Key", obj, CurrentTime + DalayTime);


2011/11/23 Siddharth Jagtiani <[email protected]>

> Hi,
>
> I am wondering if there is a way to set "no expiry" for objects in the
> cache. I understand the fact that under stress, cache may expiry and kick
> out objects, in situations like low memory. But in principle I would like
> to setup a no expiry cache.
>
> I searched in the doc's but did not find anything that resembled no expiry
> setting.
>
> Please advice
> Siddharth
>



-- 
柴俊�� 敬上

Reply via email to