Hi. I'm using memcache to design a cache for the model layer of a web application, one of my biggest problems is data consistency. It came to my mind caching data like this: (key=query, value=list of object ids result of the query) for each id of the list: (key=object.id, value=object)
So, every time a query is done: If the query already exists I retrieve the objects signaled in the list from the cache. If it doesn't, all the objects of the lists are stored in the cache replacing any other old value.
Has someone use this alternative, is it god? any other ideas?