A CMS I use implements memcached by default and I'm working to expand it. One key contains an array of user information, like userstats_id and contains information like forum post counts, number of posts they've liked blah blah. The key looks like this:
[userstats_1] => Array
(
[forum_posts] => 178
[forum_likes] => 16
[forum_dislikes] => 0
[now_online] => 1
)
I'm expanding the usage of this key because I also want to store which specific forums the user is browsing, e.g.:
[userstats_forumbrowsing_1] => Array
(
[forum_browsing] => 'Foobar'
)
It would be better if I could have this within [userstats_1] as of course that makes more sense. So given also that this changes a lot more frequently than the rest of the elements of that cached array, what's the best way to get and set the elements of the cached array?
The only way I have come up with is to copy the array, manipulate it then re-set it in the cache, but that seems crazy. Thanks!