Memcached and two dimensional array

Wed Jun 28 22:00:11 UTC 2006

Memcached and two dimensional array


I have folowing situation in my project. I have "user data" identified by "user_id" and  object data identified by "object_id"

Now i need to render data of the object identified by object_id  with settings  stored in "user data". This process add a lot of overhead, so it need to be chached with memcached . So i construct key string like this in PHP  $key = user_id . "_" . object_id  It can cleany lidentify rendered data, it is fine.

But  "user data" and "object data" are changing quite fast. So i need a way to delete all data that are cached for some user, if user data are changed, and all rendered instance of certain object if the object is changed. 

Like in two dimensional array deleting a whole row or a whole column. Is it possible with memcache ?    

For now, it seems that only way to do is a flush a single key (with is insufficient) or flush entire cache with is too much....

Thanx for help.

More information about the memcached mailing list