note 90717 added to function.memcache-delete

From: Date: Tue, 05 May 2009 22:02:09 +0000
Subject: note 90717 added to function.memcache-delete
Groups: php.notes 
Request: Send a blank email to php-notes+get-154265@lists.php.net to get a copy of this message
I was searching for a function/method in this class that would "reset" (or "update", depending on how you look at it) the timeout value for a key. I was searching my butt off when I finally figured; this is the one. Example: You have accessed a web-page including something that should be "in-cache" for way more than 30 days (until the memcache server gets a downtime for some reason). Since the limit for having something in the cache is 30 days, this will be a problem. Simple (yet somewhat non-optimal) solution: <?php //How to "update" the value if($memcache_key_exists){ $memcache_obj->delete('key', (3600*24*30)); } ?> Have fun. ---- Server IP: 212.63.193.10 Probable Submitter: 81.231.109.101 ---- Manual Page -- http://www.php.net/manual/en/function.memcache-delete.php Edit -- https://master.php.net/note/edit/90717 Del: integrated -- https://master.php.net/note/delete/90717/integrated Del: useless -- https://master.php.net/note/delete/90717/useless Del: bad code -- https://master.php.net/note/delete/90717/bad+code Del: spam -- https://master.php.net/note/delete/90717/spam Del: non-english -- https://master.php.net/note/delete/90717/non-english Del: in docs -- https://master.php.net/note/delete/90717/in+docs Del: other reasons-- https://master.php.net/note/delete/90717 Reject -- https://master.php.net/note/reject/90717 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#154265) next »