Welcome Guest, Not a member yet? Register   Sign In
Caching Models with Memcached?
#15

[eluser]dmorin[/eluser]
Quote: However, I’m using models in more of an ORM sense where each instance of the model represents one database record. The models have their own get and save methods. Also, if there’s something processor intensive, I save it to a class var in case I need to reference it multiple times within a page load. Because of all of this, I thought it would be ideal to cache the object instances themselves instead of just the db results. It would also be much easier to invalidate these versus invalidating individual queries.

That's from reply #2 in this thread. I use models differently than you. Mine actually model the information in the database instead of just providing a repository for queries. Anytime I need to modify a record in the database, I do so with this model. That's the difference.

Post #5 about using __sleep() is probably the best answer for this situation.


Messages In This Thread
Caching Models with Memcached? - by El Forum - 12-15-2008, 10:42 AM
Caching Models with Memcached? - by El Forum - 12-15-2008, 11:33 AM
Caching Models with Memcached? - by El Forum - 12-15-2008, 11:40 AM
Caching Models with Memcached? - by El Forum - 12-15-2008, 03:09 PM
Caching Models with Memcached? - by El Forum - 12-15-2008, 03:18 PM
Caching Models with Memcached? - by El Forum - 12-20-2008, 10:35 PM
Caching Models with Memcached? - by El Forum - 12-21-2008, 04:15 PM
Caching Models with Memcached? - by El Forum - 01-13-2009, 09:18 PM
Caching Models with Memcached? - by El Forum - 01-13-2009, 09:24 PM
Caching Models with Memcached? - by El Forum - 01-13-2009, 09:59 PM
Caching Models with Memcached? - by El Forum - 01-14-2009, 08:38 AM
Caching Models with Memcached? - by El Forum - 01-14-2009, 08:54 AM
Caching Models with Memcached? - by El Forum - 01-14-2009, 09:13 AM
Caching Models with Memcached? - by El Forum - 01-14-2009, 09:45 PM
Caching Models with Memcached? - by El Forum - 01-15-2009, 08:51 AM
Caching Models with Memcached? - by El Forum - 01-16-2009, 05:53 AM
Caching Models with Memcached? - by El Forum - 01-16-2009, 08:44 AM
Caching Models with Memcached? - by El Forum - 01-24-2009, 10:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB