I have a large amount of data in memcache, and currently i am troubling with How can i update value on memcache?
I have set value with multi-dimention array..
and now i have two cases here:
- I want to add new value in Memcache in same key
- I want to update some value of one particular array.
I know i can do that by get -> modify -> set
$data=$m->get('foo');
$data[]=array('id'=>134,'title'=>'My First Car','content'=>'I love my car');
$m->set('foo',$data,TRUE,0);
In this example..user can change its title, content
etc. so i need to update these information in memcache.
But getting data on every change which is more than 1MB, that will not be a good idea.
and I also learn about append
but it says it only works for string
values. that means i can not append Array
to with existing key
.
Is there any way to set/update data on existing key without getting data?
Please help..