Say if you want to allow a user to be able to delete some data, but typically it is static and good for caching. Is there a way to remove that value from the key so you can keep everything else cached and get rid of what the user wanted deleted? The key would be an array of many arrays. The arrays hold the info for the item like id, user name, title, etc. and would want to remove one of those arrays if the user wants to delete.
Example code:
Storing stuff:
$cachedData = $this->memcache->get($this->key);
if($cachedData === false){
$cachedData = array();
$sql = "SELECT id, name FROM table LIMIT 100";
$res = mysql_query($sql);
while($rec = mysql_fetch_assoc($res)){
$cachedData[] = $rec;
}
// cache for 10 minutes
$this->memcache->set($this->key, $cachedData, 0, 600);
}
It's basically right from google code example.
SELECT id, name FROM table LIMIT 100so you have those 100 put in the key and want to delete one of those.