简体   繁体   中英

Php memcache extend data time

Im using memcache with php. Upon storing data I set how long data should last (30minutes ie), then in that time, this data is being updated many times, but I believe timer doesnt update, right?

Why I say so? Because it doesnt matter if I update my data with new timer, but it still gets destroyed after 30minutes.

A lot better way of using memcached for me would be extending time for X key data.

Should I delete data stored in memory before updating (to increase deletion timer) it or is there any other ways?

edit: mistake, I use memcache, not memache* d *

SOLVED For memcacheD use Ben's answer. But for memcache, use this one http://www.php.net/manual/en/memcache.set.php#84032

Thanks!

You can use $memcached->touch($key, $duration); to increase the duration the data is stored.

Memcached::touch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM