Ask Zend_cache how to deal with
Recently in the study of PHP cache database data problems, has been using the Zend Framework, there are zend_cache cache classes, directly to take over, now is a bit of a problem.
A user table needs to be cached:
The main code is as follows:
$memcache =zend_registry::get (' memcache ');
if (! $admindata = $memcache->load (' data ')) {
$m _admin = new Model_admin ();
$admindata = $m _admin->getalladmin ();
$memcache->save ($admindata, ' data ');
}
A cached content labeled ' data ' is cached as above.
The difficulty is that how to update this cache will be better, the user volume of this table is quite a lot of, some properties are also in this user table, so the whole table is still quite large. Does it mean that I have a user who has changed some of the information, then I've cleared the entire cache and saved it? Or do I update this user's information separately? (If this is the case, how to deal with it?) )? Or do you have any other ways of dealing with the heroes, please?
Cache Zend Database
------Solution--------------------
This cache is designed to be much thinner, depends on your data size and update frequency.
The cache is too thick to cause the update to be too fast