[eluser]kpi[/eluser]
Hi all, I've been using Wanwizard's Datamapper for a while now and it's great!
I've also recently started reading up a bit on caching and I'm trying to figure out how to use Memcached with Datamapper but I'd like some advice to make sure I'm doing it right.
I know there's a driver for Memcached in CI. So, assuming I set up Memcached correctly, is this what happens when I want to make use of it:
Say I have a multi-user app where all the users share a DB table 'contacts'.
If I want to display Bob's contacts I'd first look for a 'contacts-425' key (assuming 425 is his id) in the cache, right?
Then, if that's not there I'd get the result from Datamapper (an object) and store it there for future use?
Is that good practice? Should I store the full DM object in there? Or is there a better way of doing it?
Is there a problem with creating cache keys on a user level?
Thanks